Skip to content

GitHub Actions Workflow

To run an action graph on GitHub, you need a GitHub Actions workflow YAML file that invokes the actionforge/action action. This action reads your .act graph file and executes it on the GitHub runner.

Create a YAML file in .github/workflows/ and save your .act graph file in .github/workflows/graphs/:

  • Directory.github/
    • Directoryworkflows/
      • my-workflow.yml workflow YAML
      • Directorygraphs/
        • my-workflow.act action graph

For example, my-workflow.yml:

.github/workflows/my-workflow.yml
name: Run Graph
on:
push:
jobs:
run-graph:
runs-on: ubuntu-latest
name: Run Graph
steps:
- name: Run Graph
uses: actionforge/action@866e7df1ce5e84a2b32fda7414812ae72000dae8 # v0.14.6
with:
graph-file: .github/workflows/graphs/my-workflow.act
inputs: ${{ toJson(inputs) }}
secrets: ${{ toJson(secrets) }}
matrix: ${{ toJson(matrix) }}
needs: ${{ toJson(needs) }}

The on: trigger in this YAML file should match the events you connected in your graph. For example, if your graph uses the on_push output of the GitHub Actions Start node, use on: push in the workflow file.

Commit both the .act graph file and the .yml workflow file, then push:

Terminal window
git add .github/workflows/graphs/my-workflow.act .github/workflows/my-workflow.yml
git commit -m "Add action graph workflow"
git push

GitHub will automatically pick up the workflow and run it on the next matching event.