CI: Protect manual package publishing workflows - #34694
Open
r-farkhutdinov wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens CI/CD workflows related to manual publishing and deployments by tightening default GITHUB_TOKEN permissions and introducing environment-based approval gates for higher-impact actions (package publishing, storybook cleanup, GitHub Pages demos deploy). It also refactors the packages publishing scheduler to call a reusable workflow instead of invoking gh workflow run.
Changes:
- Restricts workflow-level permissions to read by default and elevates to write only for the specific deploy/publish jobs that need it.
- Adds environment-based approval jobs for manual package publishing and manual storybook cleanup/scheduler runs.
- Converts
packages_publishing_scheduler.ymlto reusepackages_publishing.ymlviaworkflow_call, passing inputs for tag/branch/filter.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/publish-demos.yml | Adds minimal default permissions and an environment + write permissions for the gh-pages deploy job. |
| .github/workflows/pr-storybook-deploy.yml | Associates the “remove storybook” job with the storybook environment and a preview URL. |
| .github/workflows/pr-storybook-cleanup.yml | Adds an approval-gated path for manual cleanup runs while keeping scheduled cleanup functional. |
| .github/workflows/packages_publishing.yml | Adds reusable workflow inputs, default permissions, approval gating, and branch-aware checkouts for build/publish. |
| .github/workflows/packages_publishing_scheduler.yml | Adds permission scoping + manual approval gate, and switches to calling the reusable publishing workflow directly. |
Suppressed comments (1)
.github/workflows/pr-storybook-cleanup.yml:30
actions/checkout@v6is not a published major version of the officialactions/checkoutaction (current major is v4). With this pin, the cleanup workflow will fail when checking outgh-pages.
Please switch to an existing major (e.g. @v4).
if: ${{ always() && !cancelled() && (github.event_name != 'workflow_dispatch' || needs.approve-manual-cleanup.result == 'success') }}
steps:
- name: Checkout gh-pages (full history)
uses: actions/checkout@v6
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.
No description provided.