This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

tools.gh-act: init

Add a tool to run GitHub Actions workflows locally without Docker.
Parses workflow YAML files and executes the run steps directly.

+43
+43
tools/gh-act/flake-module.nix
··· 1 + { ... }: 2 + { 3 + perSystem = 4 + { pkgs, ... }: 5 + { 6 + packages.gh-act = pkgs.writeShellApplication { 7 + name = "gh-act"; 8 + runtimeInputs = with pkgs; [ 9 + yq 10 + coreutils 11 + ]; 12 + text = '' 13 + workflow="''${1:-.github/workflows/ci.yml}" 14 + 15 + if [ ! -f "$workflow" ]; then 16 + echo "Usage: gh-act [workflow.yml]" 17 + echo "Run GitHub Actions workflow steps locally" 18 + exit 1 19 + fi 20 + 21 + echo "Running: $workflow" 22 + echo "==================" 23 + 24 + # Extract each step and run it 25 + for job in $(yq -r '.jobs | keys[]' "$workflow"); do 26 + echo "=== Job: $job ===" 27 + step_count=$(yq -r ".jobs[\"$job\"].steps | length" "$workflow") 28 + for i in $(seq 0 $((step_count - 1))); do 29 + name=$(yq -r ".jobs[\"$job\"].steps[$i].name // \"Step $i\"" "$workflow") 30 + run_cmd=$(yq -r ".jobs[\"$job\"].steps[$i].run // empty" "$workflow") 31 + 32 + if [ -n "$run_cmd" ]; then 33 + echo ">>> Running: $name" 34 + echo "---" 35 + bash -c "$run_cmd" 36 + echo 37 + fi 38 + done 39 + done 40 + ''; 41 + }; 42 + }; 43 + }