Skip to content

Fix internal build for forks of org members - #7243

Open
ketanhwr wants to merge 1 commit into
mainfrom
ketan/fix-internal-build-fork
Open

Fix internal build for forks of org members#7243
ketanhwr wants to merge 1 commit into
mainfrom
ketan/fix-internal-build-fork

Conversation

@ketanhwr

@ketanhwr ketanhwr commented Sep 4, 2026

Copy link
Copy Markdown
Member

Internal build stopped working a few weeks ago when Github changed their defaults for running pull_request_target workflows on forks: https://github.blog/changelog/2026-06-18-safer-pull_request_target-defaults-for-github-actions-checkout/

In our case, we only checkout the code after we've verified that the fork belongs to an org member, so it should be safe.

@ketanhwr
ketanhwr requested review from a team as code owners September 4, 2026 08:13
@ask-bonk

ask-bonk Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

pull_request.user is the PR opener, not the fork owner. An org member can open a PR from an external owner's fork (for example, as a collaborator); the owner then controls the checked-out branch. With allow-unsafe-pr-checkout: true, that code runs with internal-build secrets. Authorize the head repository owner instead.

          AUTHOR: ${{ github.event.pull_request.head.repo.owner.login }}

@ask-bonk

ask-bonk Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

PR #7243 enables trusted fork checkout for the internal build workflow.

  1. [HIGH] .github/workflows/internal-build.yml:24 authorizes the PR opener instead of the fork owner, enabling an external fork owner to run code with internal-build secrets. Posted a suggestion comment.

github run

@ketanhwr
ketanhwr force-pushed the ketan/fix-internal-build-fork branch from e43bfc0 to d1de5bc Compare September 4, 2026 09:02
@ketanhwr
ketanhwr force-pushed the ketan/fix-internal-build-fork branch from d1de5bc to 34c9b79 Compare September 4, 2026 09:07
@ask-bonk

ask-bonk Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

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