Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check-merge workflow on PRs from forks #10366

Merged
merged 1 commit into from
Mar 8, 2024
Merged

Fix check-merge workflow on PRs from forks #10366

merged 1 commit into from
Mar 8, 2024

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Mar 8, 2024

Changes

Noticed that the check-marge workflow was failing for #10189. As noted in the GH docs, GITHUB_TOKEN has a hard permission limit for PRs from forks. The way to elevate the permissions and "trust" this PR is to use the pull_request_target event.

However, when using that event, actions/checkout will only operate on the base branch of the PR. I needed to update actions/checkout to checkout the head of the PR instead to fix this. This means we can "trust" the code coming from the PR with the elevated GITHUB_TOKEN permissions, but the workflow isn't executing code from the PR so this is safe. tj-actions/changed-files also have a helpful note about it.

Testing

Should work

Docs

n/a

Copy link

changeset-bot bot commented Mar 8, 2024

⚠️ No Changeset found

Latest commit: cbcac07

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the 🚨 action Modifies GitHub Actions label Mar 8, 2024
@bluwy bluwy merged commit 03f79f0 into main Mar 8, 2024
12 checks passed
@bluwy bluwy deleted the fix-merge-workflow branch March 8, 2024 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 action Modifies GitHub Actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants