GitHub Actions Runner Setup
Actionforge lets you debug GitHub Actions workflow graphs on your machine, eliminating workflow bugs and reducing GitHub runner costs. When actrun detects a GitHub Actions workflow graph (i.e., one created from the GitHub Actions workflow template), it automatically sets up a simulated GitHub Actions environment so you can test your workflows locally before pushing them to GitHub.
Debug Session Setup
Section titled “Debug Session Setup”When you start a Debug Session for a GitHub Actions workflow graph, the setup dialog includes additional fields specific to GitHub Actions:
- Download Runner — Download the Actionforge runner for your platform.
- Set Local Repository Path — Enter the local path to your cloned GitHub repository. This is used as the
GITHUB_WORKSPACE. - Set GitHub Token — Create a fine-grained personal access token with minimal permissions. The token is end-to-end encrypted and can only be decrypted by your local runner.
- Copy Session Token — Copy the session token and paste it into your local runner to connect.
The dialog configures the environment for you — no manual environment variable setup is needed when using Debug Sessions.
CLI Setup (Without Debug Session)
Section titled “CLI Setup (Without Debug Session)”If you prefer to run your GitHub Actions workflow graph directly from the command line, follow these steps:
1. Download and install actrun
Section titled “1. Download and install actrun”Download and install the CLI actrun runner for your platform.
For detailed installation instructions, see the Installation Guide.
2. Create a GitHub Access Token
Section titled “2. Create a GitHub Access Token”Many GitHub Actions require a GITHUB_TOKEN to authenticate with GitHub’s API. To run these actions locally, create a fine-grained personal access token :
- Click Generate new token
- Give it a descriptive name (e.g., “actrun local development”)
- Set an expiration date
- Select the repositories you want to access
- Under Repository permissions, grant the permissions your actions need. Unless you need specific GitHub API features, leave the default permissions which give
readaccess to public resources. - Click Generate token and copy the token
Set the token as an environment variable before running actrun:
export ACT_INPUT_TOKEN="ghp_your_token_here"PowerShell
$env:ACT_INPUT_TOKEN = "ghp_your_token_here"Command Prompt
set ACT_INPUT_TOKEN=ghp_your_token_here3. Set required environment variables
Section titled “3. Set required environment variables”Navigate to your repository root and set the following environment variables:
cd /path/to/your/repoexport GITHUB_WORKSPACE="$(pwd)"export GITHUB_EVENT_NAME="push"PowerShell
cd C:\path\to\your\repo$env:GITHUB_WORKSPACE = (Get-Location).Path$env:GITHUB_EVENT_NAME = "push"Command Prompt
cd C:\path\to\your\reposet GITHUB_WORKSPACE=%CD%set GITHUB_EVENT_NAME=push| Variable | Description |
|---|---|
GITHUB_WORKSPACE | Path to your git repository root. actrun uses this to detect the repository name, branch, and commit. |
GITHUB_EVENT_NAME | The event that triggered the workflow (e.g., push, pull_request, workflow_dispatch). |
4. Run actrun
Section titled “4. Run actrun”actrun my_workflow.actAutomatic Environment Setup
Section titled “Automatic Environment Setup”When actrun detects a GitHub Actions workflow graph running outside of GitHub Actions, it automatically configures the following environment variables based on your git repository:
| Variable | Value | Purpose |
|---|---|---|
CI | true | Signals CI environment |
GITHUB_ACTIONS | true | Signals GitHub Actions environment |
GITHUB_REPOSITORY | owner/repo | Derived from git remote origin |
GITHUB_REF | refs/heads/branch | Current git branch reference |
GITHUB_REF_NAME | branch | Current branch name |
GITHUB_SHA | Commit hash | Current HEAD commit |
RUNNER_OS | macOS / Linux / Windows | Detected operating system |
RUNNER_ARCH | X64 / ARM64 | Detected CPU architecture |
RUNNER_TEMP | Temp directory | Scratch space for actions |
RUNNER_TOOL_CACHE | ~/.actrun/tool-cache | Where actions cache tools |
The following files for action communication are also created automatically:
| Variable | Purpose |
|---|---|
GITHUB_OUTPUT | Actions write outputs here |
GITHUB_ENV | Actions set env vars here |
GITHUB_PATH | Actions add PATH entries here |
GITHUB_STATE | Actions save state here |
GITHUB_STEP_SUMMARY | Actions write summaries here |
Working Directory
Section titled “Working Directory”By default, actrun sets the working directory to GITHUB_WORKSPACE for GitHub Actions workflow graphs. You can override this with the ACT_CWD environment variable:
export ACT_CWD="/path/to/custom/workdir"PowerShell
$env:ACT_CWD = "C:\path\to\custom\workdir"Command Prompt
set ACT_CWD=C:\path\to\custom\workdirACT_CWD takes precedence over GITHUB_WORKSPACE when both are set.
Optional Variables
Section titled “Optional Variables”If an action requires additional variables, add these to your environment:
# Workflow metadataexport GITHUB_WORKFLOW="My Workflow"export GITHUB_JOB="build"export GITHUB_RUN_ID="1"export GITHUB_RUN_NUMBER="1"
# GitHub URLsexport GITHUB_SERVER_URL="https://github.com"export GITHUB_API_URL="https://api.github.com"export GITHUB_GRAPHQL_URL="https://api.github.com/graphql"
# User info (replace with your details)export GITHUB_REPOSITORY_OWNER="your-username"export GITHUB_ACTOR="your-username"