GitHubWorkflow 1.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global GitHubWorkflow --version 1.1.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local GitHubWorkflow --version 1.1.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=GitHubWorkflow&version=1.1.1
                    
nuke :add-package GitHubWorkflow --version 1.1.1
                    

nuget nuget   DeepWiki

đŸ‡ē🇸 English   ❘   đŸ‡¯đŸ‡ĩ æ—ĨæœŦčĒžį‰ˆ   ❘   đŸ‡¨đŸ‡ŗ įŽ€äŊ“ä¸­æ–‡į‰ˆ

ghx runs GitHub Actions workflow as a batch script on Windows, macOS and Linux.

✨ Key Features

  • Matrix Expansion: preview and run every combo or keep only the first for speed.
  • Bash to CMD Conversion: Windows or bash, no tweaks needed.

🚀 Usage

⚡ Instant Execution (dnx)

dnx ghx -- dry my-workflow

đŸ“Ļ Install as a Tool (ghx)

dotnet tool install -g ghx

Run by ghx: GitHub workflow eXecute

ghx new my-workflow     # create new workflow
ghx dry my-workflow     # dry run (prints generated script)
ghx my-workflow --once  # run only the first matrix combination

âš™ī¸ Command Line Options

Synopsis:

ghx [command] [options] <workflow-file>

Commands

  • run: writes a temp script file and execute. (default)
  • dry: prints run steps
  • new: creates a workflow file under .github/workflows (uses .github/ghx_template.yml|.yaml if present)

Options

  • --cmd: emit Windows cmd.exe-formatted output (default on Windows only; on macOS/Linux, use with dry to preview only).
  • --wsl: force bash-compatible output; conflicts with --cmd.
  • --once/-1: keep only the first matrix combination per job (skips the rest).
  • workflow-file: required, must be the file name only (no paths). Resolves to .github/workflows/<name>.yml|.yaml relative to the current directory.

🧭 Common Usecase

Create a new workflow:

ghx new test   # creates .github/workflows/test.yml

If .github/ghx_template.yml or .github/ghx_template.yaml exists at the repo root, that file is copied verbatim; otherwise the default stub is used.

Edit template:

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  workflow_call:
  workflow_dispatch:

jobs:
  test:

    # Basic bash-to-cmd conversion is supported
    # See Technical Notes for further information
    runs-on: ubuntu-latest

    # Matrix expansion is supported
    strategy:
      matrix:
        configuration: [Debug, Release]

    # 'uses' are completely ignored
    steps:
      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5      # v4.3.1
      - uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9  # v4.3.1
        with:
          dotnet-version: 10.x.x

      # Collects all 'run' steps from workflow file
      - name: Test
        run: |
          dotnet restore ./src
          dotnet build ./src \
            --no-restore \
            -c ${{ matrix.configuration }}

  # Multiple jobs are supported
  other_job:
   ...

From a repo root with .github/workflows/test.yml present, quickly inspect what will run:

ghx dry test

Trial-run the same workflow locally with matrix expansion collapsed to a single combination:

ghx run test --once

On Windows, force cmd.exe formatting or override it to emit bash-compatible scripts:

ghx run test --cmd    # default on Windows
ghx run test --wsl    # force bash via WSL/bash even on Windows

🧩 Composite Actions

Here shows GitHub Actions composite sample that uses reusable test workflow.

name: ci

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  workflow_dispatch:

jobs:

  test:
    uses: ./.github/workflows/test.yml    # 👈👈👈

  # Subsequent job depending on 'test' result
  build:
    needs: test
    if: ${{ !failure() }}
    runs-on: ubuntu-latest

    steps:
    - uses: ...

Reusable workflow cannot be used in conjunction with steps.

📝 Supported Features Overview

Feature Support Level Notes
workflow_call trigger ✅ Full Primary use case; workflow_dispatch also works
Input definitions ✅ Full Type declarations ignored; defaults required if referenced
Matrix strategies ✅ Full Cartesian product expansion; --once flag available
Multiple jobs ✅ Full Sequential execution; no parallelization or environment isolation
Run steps ✅ Full Only run: blocks extracted; uses: actions ignored
Placeholder expressions âš ī¸ Partial ${{ inputs.* }} and ${{ matrix.* }} supported; others unsupported
Bash scripts ✅ Full Default shell; cross-platform with conversion
Custom shells ❌ None shell: property causes error
Runners âš ī¸ Limited Only ubuntu-latest executed; others display warning
Positional parameters âš ī¸ Limited $0-$9 converted to %0-%9 for CMD
Sleep commands ✅ Full sleep N → TIMEOUT /T N /NOBREAK >nul on Windows

Technical Notes

  • Placeholder values for inputs.* and matrix.* are pulled from defaults/matrix entries and quoted as needed.
  • Any >> $GITHUB_STEP_SUMMARY or > $GITHUB_STEP_SUMMARY redirections are removed from generated commands.
  • Inline comments (# ...) in run steps are stripped before processing.
  • Steps cannot specify a custom shell; the tool only supports the default shell for the selected output format and will error if a step sets shell.
  • Bash-to-cmd conversion replaces trailing \ with ^, prepends CALL (since many tools ship as .bat/.cmd), and appends a failure guard to mimic bash -e behavior on Windows.
  • sleep <n> lines inside run blocks become TIMEOUT /T <n> /NOBREAK >nul in cmd output; only integer durations are supported.
  • During cmd conversion, positional placeholders $0–$9 in run steps become %0–%9 (only single-digit positions are supported).
  • Workflow inputs.* may omit defaults, but if a run step references one without a default, the tool fails fast.
  • Multiple jobs are supported, but they share process state; no environment reset happens between jobs.
  • Jobs are executed sequentially; a job starts only after all matrix combinations from the previous job finish.
  • Expands matrix combinations (optional --once to keep only the first).
  • Matrix handling is basic: only simple axes arrays are supported (no include/exclude/fail-fast/max-parallel or nested objects).
  • Generates bash or Windows cmd-formatted scripts.

âŗ Missing Features

TODO

  • -i/--input key=value: Ability to override inputs of workflow_call (allow multiple)
  • --step-summary <path>: Instead of removing redirections, set custom output path for.
  • $* and $@ conversion: %* exists in cmd but it is not complete equivalent. ("$@" is equivalent to %*; quote required)
  • runs-on: Due to bash to cmd conversion is only supported, it doesn't accept rather than ubuntu-latest.
  • Native AOT Support: Some report found that VYaml can be compiled with Native AOT enabled.
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.2.1 152 12/14/2025
1.2.0 153 12/14/2025
1.1.2 166 12/14/2025
1.1.1 116 12/13/2025
1.1.0 107 12/13/2025
1.0.2 130 12/12/2025
1.0.1 424 12/11/2025
1.0.0 436 12/10/2025
0.2.0 426 12/10/2025
0.1.0 432 12/10/2025