Gets the latest completed run of the current workflow on the current branch.
Useful for comparing artifacts, caches, or outputs between the current run and the previous successful one (e.g. bundle size diffs, performance regressions).
- uses: crustacean-dev/latest-workflow-run-action@v1
id: latest-run
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: echo "Latest run ID: ${{ steps.latest-run.outputs.run-id }}"
if: steps.latest-run.outputs.found == 'true'| Name | Required | Default | Description |
|---|---|---|---|
github-token |
Yes | — | Token for the GitHub API |
conclusion |
No | success |
Filter by conclusion: success, failure, cancelled, or empty for any |
| Name | Description |
|---|---|
run-id |
The ID of the latest matching workflow run (empty if none found) |
found |
Whether a matching run was found ('true' or 'false') |
- uses: crustacean-dev/latest-workflow-run-action@v1
id: latest-run
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v4
if: steps.latest-run.outputs.found == 'true'
with:
name: build-output
run-id: ${{ steps.latest-run.outputs.run-id }}
github-token: ${{ secrets.GITHUB_TOKEN }}- uses: crustacean-dev/latest-workflow-run-action@v1
id: latest-run
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ""- Detects the current branch (supports both push and pull_request events)
- Resolves the numeric workflow ID from the current run
- Queries the GitHub API for the latest completed run matching the branch and conclusion filter