Repository navigation
Opt in to fork PR checkout in format-suggest - #137
Merged
Merged
Conversation
actions/checkout v4.4.0, v5.1.0, v6.1.0 and v7.0.1 (released 2026-07-20) added an `allow-unsafe-pr-checkout` input, false by default. It is required to check out fork PR code from a `pull_request_target` workflow, which is what this workflow does to format and suggest changes on external contributors' PRs. The workflow pins `actions/checkout@v6`, so it follows the tag to the version that has the input. Set it to true, as the upstream posit-dev/setup-air format-suggest example now does. The safety argument is unchanged: the PR files are only formatted by `air`, never executed.
Match the posit-dev/setup-air format-suggest example this workflow is derived from, which now uses checkout v7 with `allow-unsafe-pr-checkout`.
1 task
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.
Since 20 Jul 2026,
actions/checkoutrefuses to check out fork PR code from apull_request_targetworkflow unlessallow-unsafe-pr-checkoutis set totrue. The format-suggest workflow does exactly that to suggest formatting changes on external contributors' PRs, and it uses the floatingactions/checkout@v6tag, which has the new input. I believe the next fork PR would fail at the checkout step. I could not confirm it, there has been no PR since 19 May.This sets the input to
trueand moves checkout to v7, as the format-suggest example in posit-dev/setup-air now does (posit-dev/setup-air#100). The checkout stays safe for the reason in the comment at the top of the workflow: the PR files are only formatted byair, never executed.GitHub also blocks
pull_request_targetin public repos by default from 2 Dec 2026, unless an Actions event policy allows it (https://github.blog/changelog/2026-11-02-pull_request_target-blocked-by-default-december-2/). That is a repo setting, so it is not part of this diff. I'll add a policy for this workflow.Test Plan