Skip to content

Opt in to fork PR checkout in format-suggest - #137

Merged
cderv merged 2 commits into
mainfrom
ci/format-suggest-allow-pr-checkout
Nov 20, 2026
Merged

cderv merged 2 commits into
mainfrom
ci/format-suggest-allow-pr-checkout

Conversation

@cderv

@cderv cderv commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Since 20 Jul 2026, actions/checkout refuses to check out fork PR code from a pull_request_target workflow unless allow-unsafe-pr-checkout is set to true. The format-suggest workflow does exactly that to suggest formatting changes on external contributors' PRs, and it uses the floating actions/checkout@v6 tag, 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 true and 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 by air, never executed.

GitHub also blocks pull_request_target in 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

  • After merge, format-suggest runs and posts suggestions on the next fork PR

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`.
@cderv
cderv merged commit 81ddaa6 into main Nov 20, 2026
15 of 18 checks passed
@cderv
cderv deleted the ci/format-suggest-allow-pr-checkout branch November 20, 2026 09:04
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.

1 participant