feat(ci): run storybook cleanup daily#20332
Merged
MagentaManifold merged 1 commit intomainfrom Apr 7, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Storybook cleanup GitHub Actions workflow so cleanup isn’t dependent on a PR-close event (which can be skipped/canceled due to concurrency), and instead runs on a daily schedule with an optional manual trigger.
Changes:
- Switch workflow trigger from
pull_request: closedto a dailyschedulecron plusworkflow_dispatch. - Replace single-PR deletion logic with a loop that scans
gh-pages/storybooks/pr-*and deletes entries for closed (or missing) PRs via the GitHub API. - Avoid unnecessary forced pushes by skipping the push when
git statusshows no changes, and align index generation env var usage with existing workflows.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a42890a to
3462bab
Compare
vpomerleau
approved these changes
Apr 7, 2026
| [ -d "$dir" ] || continue | ||
| PR_NUMBER=$(basename "$dir" | sed 's/^pr-//') | ||
| STATE=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}" --jq '.state') | ||
| if [ "$STATE" = "closed" ] || [ "$STATE" = "not_found" ]; then |
Contributor
There was a problem hiding this comment.
It looks like state can only be open or closed - if the PR never existed, then this would result in a 404 (not handled here). Unlikely scenario since the storybook folders are generated from a PR in the first place, but we probably want to either specifically handle the 404 or remove the "not_found" state.
Because: * sometimes a cleanup job gets cancelled due to concurrency settings This commit: * turns storybook cleanup into a daily cronjob that searches through all PRs stored and cleanup closed ones
3462bab to
e6e457d
Compare
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.
Because
This pull request
Issue that this pull request solves
Closes: (issue number)
Checklist
Put an
xin the boxes that applyHow to review (Optional)
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
Rational of this PR: