Skip to content

v0.18.0

Choose a tag to compare

@mizchi mizchi released this 18 Mar 16:02
· 113 commits to main since this release

New: actrun export — Workflow to Shell Script Transpiler (Experimental)

Convert GitHub Actions workflows to standalone bash scripts.

actrun export .github/workflows/ci.yml              # Sequential
actrun export .github/workflows/ci.yml --parallel   # Parallel jobs with & + wait
actrun export .github/workflows/ci.yml --job lint    # Single job

Expression resolution:

  • ${{ env.VAR }} → $VAR
  • ${{ secrets.TOKEN }} → $SECRET_TOKEN
  • ${{ github.ref }} → $GITHUB_REF (20+ known mappings)
  • ${{ github.event.* }} → $(jq -r '.path' "$GITHUB_EVENT_PATH")
  • ${{ matrix.os }} → $MATRIX_OS
  • ${{ steps.id.outputs.key }} → $_STEP_ID_KEY
  • ${{ needs.job.outputs.key }} → $_NEEDS_JOB_OUT_KEY
  • ${{ needs.job.result }} → $_NEEDS_JOB_RESULT (success/failure)
  • echo "key=val" >> "$GITHUB_OUTPUT" → _STEP_ID_KEY=val
  • echo "KEY=val" >> "$GITHUB_ENV" → export KEY=val

jq-based expression helpers (contains, startsWith, endsWith, toJSON, fromJSON, hashFiles, format, join, success, failure, always, cancelled):

gha_contains() { [[ "$1" == *"$2"* ]]; }
gha_toJSON() { jq -n --argjson v "$(printenv | jq -Rs ...)" '$v'; }
gha_hashFiles() { cat "$@" 2>/dev/null | sha256sum | cut -d' ' -f1; }

Structural features:

  • Jobs as shell functions (job_BUILD(), job_DEPLOY())
  • Topological sort for dependency order
  • needs outputs propagated via shell variables
  • --parallel: layer-based concurrency with & + wait + temp file IPC
  • Reusable workflows (uses: ./path/to/callee.yml) inlined with inputs
  • Matrix defaults from first row
  • continue-on-error → || true
  • working-directory → pushd/popd
  • Origin comments: # ← ${{ original }} on transformed lines

Action conversions:

Action Shell equivalent
actions/checkout git clone / git fetch
actions/setup-node Commented: mise use, fnm, nvm
actions/setup-python Commented: mise use, uv, pyenv
actions/upload-artifact cp -r to artifact dir
actions/download-artifact cp -r from artifact dir
actions/cache No-op comment
docker://image docker run --rm

Verified: 32/36 examples execute correctly via actrun export | bash

Export Snapshot Tests

  • just snapshot-export-update / just snapshot-export-verify
  • 16 examples × 2 variants (sequential + parallel) = 32 golden files

What's Changed

  • Add lint, viz, and CI hardening (0.17.0) by @mizchi in #12

Full Changelog: v0.17.0...v0.18.0