Gate Pages preview build/deploy to trusted authors#3685
Open
RomanIakovlev wants to merge 1 commit into
Open
Conversation
This workflow uses pull_request_target and checks out untrusted PR code, then builds and deploys it to a public preview domain. Add an author guard so only same-repo PRs and trusted authors (OWNER/MEMBER/COLLABORATOR) build and deploy automatically. Also re-enables the workflow (previously disabled). Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Re-enables the GitHub Pages preview deployment workflow for PRs while adding a guard to prevent untrusted fork PRs from building and deploying attacker-controlled content via pull_request_target.
Changes:
- Re-enables the previously commented-out Pages preview workflow.
- Adds a
buildjobif:condition to allow preview builds only for same-repo PRs or trusted author associations (OWNER/MEMBER/COLLABORATOR). - Keeps
deploychained behindbuildvianeeds: buildso the guard gates deployments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/jekyll-preview.yml | Re-enables preview deploy workflow and adds an author-association guard on the build job. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 2
Comment on lines
+17
to
+18
| # Allow only one concurrent deployment per PR, skipping runs queued between the run in-progress and latest queued. | ||
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
pphhtt8887777-ctrl
referenced
this pull request
Jun 11, 2026
PeerJ returns 403 to GitHub Actions runners (likely Cloudflare bot detection), even though the URL resolves fine in a browser. The link is cited in building-community.md (and all translations) and the content is still valid, so adding it to the existing url_ignores list matches the pattern used for other sites that block automated requests.
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.
What
Re-enables the Pages preview workflow (temporarily disabled) and adds an author guard to the
buildjob.Why
The workflow uses
pull_request_targetand checks out PR-author code, then builds and deploys it to a public preview domain. Without an author check, any fork PR can deploy attacker-controlled content to that GitHub-owned domain. The guard restricts automatic build/deploy to same-repo PRs and trusted authors (OWNER/MEMBER/COLLABORATOR).author_associationis re-evaluated on every event and cannot be set by the PR author, so it is not subject to label-based bypasses.deployalready declaresneeds: build, so gatingbuildgates the whole chain.Recommended follow-up (repo setting)
For defense-in-depth — and to allow previews from other contributors via approval rather than skipping them — add Required Reviewers to the Pages Preview environment (Settings → Environments). It currently has only a branch policy.
Notes
actionlint.