feat(ci): Skip Storybook CI when bot updates only snapshots.yml#57799
Merged
feat(ci): Skip Storybook CI when bot updates only snapshots.yml#57799
Conversation
When a bot (github-actions[bot], posthog-bot, etc.) commits only frontend/snapshots.yml on a PR branch, the visual baseline has already been reviewed and approved — re-running the full storybook suite burns CI credits for no signal. Adds a `snapshots` dorny filter and extends the `frontend` output expression to short-circuit when: event is pull_request, actor is a bot, and snapshots_count == frontend_count (no other frontend files changed). Master pushes and human commits are unaffected. https://claude.ai/code/session_01NRAL5ZwjdkFrQkA4r1GafT
rnegron
approved these changes
May 6, 2026
| # | ||
| # Additionally skip when a bot commits only frontend/snapshots.yml on | ||
| # a PR — that file is updated automatically after human review and CI | ||
| # approval, so re-running the full storybook suite is pure waste. |
Contributor
|
Reviews (1): Last reviewed commit: "chore(ci): skip storybook on bot-only sn..." | Re-trigger Greptile |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes the Storybook CI workflow by skipping expensive Storybook jobs when a bot updates only frontend/snapshots.yml on a pull request, avoiding redundant runs for an auto-updated file.
Changes:
- Add a
snapshotspaths-filter targetingfrontend/snapshots.yml. - Update the
changesjob’sfrontendoutput condition to skip Storybook on PRs when the actor is a bot and the only changed frontend file issnapshots.yml.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Storybook CI workflow runs unnecessarily when a bot (like PostHog Bot) commits changes that only update
frontend/snapshots.yml. This file is automatically updated after human review and CI approval, so re-running the full Storybook suite in these cases is wasteful.Changes
Updated the
ci-storybook.ymlworkflow to:snapshotsthat matchesfrontend/snapshots.ymlfrontendjob condition to skip execution when:[bot]or isposthog-bot)snapshots.ymlThis prevents unnecessary Storybook builds while still running the full suite for actual code changes.
How did you test this code?
The changes are to GitHub Actions workflow configuration. The logic will be validated by the CI system itself when:
frontend/snapshots.ymlchanges (job should skip)Publish to changelog?
No
https://claude.ai/code/session_01NRAL5ZwjdkFrQkA4r1GafT