Increase retry attempts and allow unsafe PR checkout in workflows - #71
Merged
Merged
Conversation
Contributor
⚡ Successfully deployed to Cloudflare Pages!
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The publishing workflow can execute fork-controlled code with deployment secrets, and its label guard is not exact.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR improves workflow retries and configures fork PR checkout behavior for publishing.
Changes:
- Adds three retries to the GitHub Script workflow step.
- Disables persisted checkout credentials and enables unsafe PR checkout.
File summaries
| File | Summary |
|---|---|
.github/workflows/publish.yml |
Critical security concern with executing fork-controlled code using deployment secrets; moderate concern with non-exact label matching. |
.github/workflows/create-plugin-pr.yml |
Adds retries to GitHub Script operations. |
Review details
Suppressed comments (2)
.github/workflows/publish.yml:75
- This opts the job into executing fork-controlled code under
pull_request_target, so the label gate must be exact. The job condition currently usescontains(github.event.label.name, '🚀request-deploy'); a similarly named label such as🚀request-deploy-previewwould therefore reach this unsafe checkout and the subsequent Cloudflare-token deployment even though the maintainer did not apply the documented label. Require exact equality in the guard (and keep the cleanup condition consistent), or at minimum make this opt-in expression exact as a defense-in-depth check.
allow-unsafe-pr-checkout: true
.github/workflows/publish.yml:75
- These lines claim the label is explicitly added by a maintainer, but the job condition only checks the label name and fork status; it never verifies who added the label or that the actor has maintainer-level permission. Because this
pull_request_targetjob then checks out and executes the fork with Cloudflare/GitHub credentials, a lower-privilege collaborator who can apply labels could run untrusted code with those secrets. Enforce maintainer approval (for example with an environment requiring reviewers or an explicit permission check) before enabling this checkout.
# Deploy from fork PRs only runs after a maintainer explicitly adds the
# '🚀request-deploy' label (gated by the job's `if` condition above), so
# opting in to fork checkout here is an intentional, reviewed trust boundary.
allow-unsafe-pr-checkout: true
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+71
to
+75
| persist-credentials: false | ||
| # Deploy from fork PRs only runs after a maintainer explicitly adds the | ||
| # '🚀request-deploy' label (gated by the job's `if` condition above), so | ||
| # opting in to fork checkout here is an intentional, reviewed trust boundary. | ||
| allow-unsafe-pr-checkout: true |
This branch was successfully deployed
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.
This pull request introduces improvements to the GitHub Actions workflows to enhance reliability and security when running jobs. The most important changes are grouped as follows:
Workflow Reliability Improvements:
retries: 3parameter to theactions/github-script@v9step in.github/workflows/create-plugin-pr.ymlto automatically retry the script up to three times in case of transient failures.Security and Workflow Configuration:
persist-credentials: falseand enabledallow-unsafe-pr-checkout: truein theactions/checkout@v4step of.github/workflows/publish.yml. This ensures credentials are not persisted for subsequent steps and explicitly allows checkouts from forked pull requests, but only after a maintainer review (as gated by the workflow's label and condition).