Skip to content

Gate Pages preview build/deploy to trusted authors#3685

Open
RomanIakovlev wants to merge 1 commit into
mainfrom
gate-pages-preview-trusted-authors
Open

Gate Pages preview build/deploy to trusted authors#3685
RomanIakovlev wants to merge 1 commit into
mainfrom
gate-pages-preview-trusted-authors

Conversation

@RomanIakovlev

Copy link
Copy Markdown

What

Re-enables the Pages preview workflow (temporarily disabled) and adds an author guard to the build job.

Why

The workflow uses pull_request_target and 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_association is re-evaluated on every event and cannot be set by the PR author, so it is not subject to label-based bypasses.

deploy already declares needs: build, so gating build gates 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

  • Validated with actionlint.

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 <223556219+Copilot@users.noreply.github.com>
@RomanIakovlev RomanIakovlev requested a review from a team as a code owner June 10, 2026 14:43
Copilot AI review requested due to automatic review settings June 10, 2026 14:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 build job if: condition to allow preview builds only for same-repo PRs or trusted author associations (OWNER/MEMBER/COLLABORATOR).
  • Keeps deploy chained behind build via needs: build so 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.
Comment on lines +41 to +42
- name: Checkout
uses: actions/checkout@v6.0.2
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.
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.

2 participants