GitHubWorkflow 1.1.1
See the version list below for details.
dotnet tool install --global GitHubWorkflow --version 1.1.1
dotnet new tool-manifest
dotnet tool install --local GitHubWorkflow --version 1.1.1
#tool dotnet:?package=GitHubWorkflow&version=1.1.1
nuke :add-package GitHubWorkflow --version 1.1.1
đēđ¸ 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 stepsnew: creates a workflow file under.github/workflows(uses.github/ghx_template.yml|.yamlif present)
Options
--cmd: emit Windowscmd.exe-formatted output (default on Windows only; on macOS/Linux, use withdryto 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|.yamlrelative 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.*andmatrix.*are pulled from defaults/matrix entries and quoted as needed. - Any
>> $GITHUB_STEP_SUMMARYor> $GITHUB_STEP_SUMMARYredirections are removed from generated commands. - Inline comments (
# ...) inrunsteps 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 setsshell. - Bash-to-cmd conversion replaces trailing
\with^, prependsCALL(since many tools ship as.bat/.cmd), and appends a failure guard to mimicbash -ebehavior on Windows. sleep <n>lines inside run blocks becomeTIMEOUT /T <n> /NOBREAK >nulin cmd output; only integer durations are supported.- During cmd conversion, positional placeholders
$0â$9inrunsteps 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
--onceto keep only the first). - Matrix handling is basic: only simple axes arrays are supported (no
include/exclude/fail-fast/max-parallelor nested objects). - Generates
bashor Windowscmd-formatted scripts.
âŗ Missing Features
TODO
-i/--input key=value: Ability to overrideinputsofworkflow_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 thanubuntu-latest.- Native AOT Support: Some report found that
VYamlcan be compiled with Native AOT enabled.
| Product | Versions 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. |
This package has no dependencies.