What Is GITHUB_RUN_ID?
GITHUB_RUN_ID is a unique number identifying a specific workflow run within a repository.
GITHUB_RUN_ID is stable across re-runs of the same run and is the key you use to fetch a run via the API or link to its logs.
Common uses
- Build a link to the run in the Actions UI
- Fetch run details via
gh api - Namespace temporary resources per run
Example
Construct the run URL.
shell
echo "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"Key takeaways
- GITHUB_RUN_ID uniquely identifies a run.
- Stable across re-runs.
- Use it for API calls and run links.