Keep non-required checks off the GitHub Actions critical path
When a slow GitHub Actions check sits on the PR critical path but isn't required to merge and only produces advisory output (a size comment, a preview), narrow its trigger or make it async, but never de-scope a check that actually runs tests.
How StarSling worksAI agents open the PR
StarSling agents inspect your workflow, apply this optimization, and open a reviewable PR automatically.
Do this
Genuinely advisory checks (a bundle-size comment, a preview deploy, a non-blocking lint annotation) don't rerun on every push and don't gate the merge. They run once per PR, or post asynchronously, so they inform without adding to the wait. Real tests and build validation stay on every push, for those, the lever is to make them faster, not to stop running them.12
# A size-diff comment is advisory: run it on open/ready, not on every push.
#
# Keep "reopened". The DEFAULT types are [opened, synchronize, reopened], and naming
# any types replaces that list wholesale: drop reopened and a PR that is closed and
# reopened never runs the check again. What you are removing here is "synchronize",
# the every-push trigger. That is the whole point.
on:
pull_request:
types: [opened, ready_for_review, reopened] # note: no "synchronize"Avoid this
The advisory check reruns on every push and sits on the critical path with no gating value.
on:
pull_request: # the size-diff comment reruns on every push and sits on
# the critical path, even though no one merges on itWhy it matters
The slowest check holding up a PR is sometimes one that isn't even required to merge. If it's purely advisory, running it on every push is friction with no gating value. The critical distinction: a non-required check that runs real tests or validates a build is still load-bearing developer signal, de-scoping that hides failures. Only narrow checks whose output is genuinely advisory, and if you can't confirm a check is non-required (branch-protection data is unreadable), leave it alone.
When to use
Use it when
A check that is high on the critical path, absent from the required-status list, and whose output is genuinely advisory (comment, preview, non-blocking annotation) with no downstream job depending on it.
Be careful when
Never de-scope a check that runs tests or validates a build, one that feeds a required aggregator, or one whose required status you can't confirm. For a real gate, speed it up (cache, shard, scope) instead of dropping it.
Verify on your repo
Hand this prompt to your coding agent (Claude Code, Cursor, and the like) to audit and fix this practice in your own repo.
Inspect this repo's .github/workflows for a check that sits high on the PR critical path but is purely advisory (a bundle-size comment, a preview deploy, a non-blocking annotation) and is not required to merge. For a genuinely advisory check, narrow its trigger so it does not rerun on every push (for example `types: [opened, ready_for_review, reopened]`, which drops only `synchronize`). Keep `reopened`: naming any `types` replaces the default list wholesale, so omitting it means the check never runs again on a reopened PR, or make it post asynchronously. Do NOT de-scope any check that runs tests, validates a build, feeds a required aggregator, or whose required status you cannot confirm: for a real gate the fix is to make it faster, not to stop running it. Show me the diff and open a PR rather than applying it blindly.
Ground these changes in the upstream docs before you edit: https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows, https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks. If you cannot fetch them, say so rather than guessing, and cite what you used in the PR description.Prefer to check by hand?
Find the checks highest on your PR critical path (longest median duration in the check-runs list).
Cross-reference the required-status list (branch protection / rulesets). If the slow check isn't required AND is genuinely advisory, it's a candidate.
Enumerate consumers first: does anything
needs:it, read its output, or gate a deploy/comment on it? If so, it's required-in-effect, leave it.
Go further
One fix, all of them, or forever.
You have the prompt for this one practice. Here is how much further you can take it, each step doing more for you than the last.
Fix this one thing
Copy the prompt above
Hand OPT71 to your coding agent and fix it in your repo today.
Fix everything, once
Install the ci-speedup skill
One prompt audits your whole repo against all 73 ci-speedup patterns (this one plus 72 more) and hands your agent every fix at once. Open source, MIT, runs locally.
Keep it fixed, forever
Install the StarSling GitHub App
Connect GitHub and the fixes stay applied as your CI evolves, with agents that keep inspecting your workflows and opening optimization PRs you review.
More best practices for GitHub Actions
Where to go next in the CI best-practices catalog.
- Runner & Queue
Cut CI queue time in GitHub Actions
GitHub-hosted runners cap how many jobs your account can run at once (20 on Free, more on paid plans), so past that ceiling jobs queue for a free slot no matter how your workflows are written.
- Trigger Scope
Filter workflows with paths and paths-ignore in GitHub Actions
Add
pathsorpaths-ignoreto expensive workflows so a docs-only or unrelated change doesn't trigger the full test suite.
More ways to improve GitHub Actions
If you do not know why a run is slow yet, start with the diagnostic guide. Let an agent find which of these applies: /ci-speedup. If your workflows are already optimized but still slow, see our guide to fast GitHub Actions and GitHub Actions runner alternatives. Building containers in CI? The Docker workflow guide covers layer caching end to end. Want to see how your configuration measures up before changing anything? CI Score grades workflow config against a pass/fail rubric of these practices. It is not a speed measurement. To find exploitable workflow paths before attackers do, ci-secure checks the ten critical GitHub Actions attack vectors and lets you choose which fixes to apply.
- GitHub Actions too slow
- Fast GitHub Actions
- GitHub Actions alternatives
- GitHub Actions pricing
- Self-hosted GitHub Actions runners
- Docker CI on GitHub Actions
- Install the free /ci-score skill to improve your GitHub Actions setup
- Install the /ci-secure skill to close critical attack vectors in GitHub Actions
- Browse GitHub Actions agent skills
FAQ
How do I tell an advisory check from a real one?
Advisory checks produce information a human reads (a size comment, a preview URL) and nothing depends on their exit code. A real check validates a build or runs tests. If a non-required check does real validation, treat it as load-bearing, speed it up, don't drop it.
What if I can't see the repo's required-check list?
Then required status is unknown, and you should not de-scope. Keep the check as-is (or make its output async) rather than risk removing something that actually gates the merge.
Sources
1GitHub Actions · pull_request activity types (opens in new tab)
2GitHub · troubleshooting required status checks (opens in new tab)
Last updated 2026-08-19