A worked example, rendered from real sample data. Sign in to run the tool on your own input.
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci
- run: npm test
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm run build
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- run: echo deployingWorkflow: CI
Jobs: 3 (3 after matrix expansion) · Steps: 7 · Stages: 3
When it runs
• A push starts this workflow.
• A pull request starts this workflow.
Job graph
Stage 1: test
Stage 2: build
build ← test
Stage 3: deploy
deploy ← build
Job: test
runs-on: ubuntu-latest
timeout: not set (defaults to 360 minutes)
steps (4):
1. actions/checkout [actions/checkout@v4 — tag]
2. actions/setup-node [actions/setup-node@v4 — tag]
3. npm ci
4. npm test
Job: build
runs-on: ubuntu-latest
needs: test
timeout: not set (defaults to 360 minutes)
steps (2):
1. actions/checkout [actions/checkout@v4 — tag]
2. npm run build
Job: deploy
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
timeout: not set (defaults to 360 minutes)
steps (1):
1. echo deploying
Permissions: not set (repository default)
Concurrency: not set
Secrets referenced: none
Caching: none
Findings (0 error, 4 warning, 5 info)
[warning] No top-level permissions block
Without it the workflow inherits the repository default, which is often read/write on everything. Add `permissions: contents: read` and widen per job.
[info] No concurrency group
Pushes in quick succession will run overlapping workflows. Add a `concurrency` group with `cancel-in-progress: true`.
[warning] No timeout-minutes (test)
A stuck job burns up to 6 hours of runner time. Set `timeout-minutes` to something realistic.
[info] actions/checkout@v4 is pinned by tag, not by SHA (test › actions/checkout)
First-party actions are low
…
Parse a GitHub Actions workflow and show job/step dependencies. Part of the DevTools Surf developer suite. Browse more tools in the Developer Utilities collection.