Skip to content

feat(ci): Skip Storybook CI when bot updates only snapshots.yml#57799

Merged
webjunkie merged 1 commit intomasterfrom
claude/exempt-bot-commits-ci-Fm48j
May 6, 2026
Merged

feat(ci): Skip Storybook CI when bot updates only snapshots.yml#57799
webjunkie merged 1 commit intomasterfrom
claude/exempt-bot-commits-ci-Fm48j

Conversation

@webjunkie
Copy link
Copy Markdown
Contributor

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.yml workflow to:

  1. Added a new filter for snapshots that matches frontend/snapshots.yml
  2. Enhanced the frontend job condition to skip execution when:
    • The event is a pull request
    • The actor is a bot (contains [bot] or is posthog-bot)
    • The only changed frontend file is snapshots.yml

This 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:

  • A bot commits only frontend/snapshots.yml changes (job should skip)
  • A bot commits other frontend changes (job should run)
  • A human commits changes (job should run regardless)

Publish to changelog?

No

https://claude.ai/code/session_01NRAL5ZwjdkFrQkA4r1GafT

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
@webjunkie webjunkie changed the title Skip Storybook CI when bot updates only snapshots.yml feat(ci): Skip Storybook CI when bot updates only snapshots.yml May 6, 2026
@webjunkie webjunkie marked this pull request as ready for review May 6, 2026 13:52
@webjunkie webjunkie requested review from Copilot and rnegron May 6, 2026 13:52
@assign-reviewers-posthog assign-reviewers-posthog Bot requested a review from a team May 6, 2026 13:53
#
# 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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 6, 2026

Reviews (1): Last reviewed commit: "chore(ci): skip storybook on bot-only sn..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 snapshots paths-filter targeting frontend/snapshots.yml.
  • Update the changes job’s frontend output condition to skip Storybook on PRs when the actor is a bot and the only changed frontend file is snapshots.yml.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@webjunkie webjunkie merged commit c26b09b into master May 6, 2026
179 checks passed
@webjunkie webjunkie deleted the claude/exempt-bot-commits-ci-Fm48j branch May 6, 2026 14:02
@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented May 6, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-05-06 14:47 UTC Run
prod-us ✅ Deployed 2026-05-06 14:59 UTC Run
prod-eu ✅ Deployed 2026-05-06 15:02 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants