fix(actions): support fork checkouts and PAT pushes in assign-rfc-number - #23
Merged
Merged
Conversation
- Set `allow-unsafe-pr-checkout: true` on the **isolated** `target/` sparse checkout step to opt into `actions/checkout` v7's fork safety check.
- Authenticate git operations via `gh auth setup-git` using `FLUTTERACTIONSBOT_RFC_TOKEN` (with fallback to `GITHUB_TOKEN`) so commits can be pushed to fork PR branches where maintainer edits are enabled.
- Update PR labels (`rfc-assigned`) atomically before pushing changes so `rfc-lint` passes on the triggered `synchronize` event.
- Add top-level `permissions: {}` to enforce least-privilege defaults.
- Improve failure fallback comments with direct workflow run log links and local `dart run bin/assign_rfc_number.dart` instructions when pushing to a fork fails.
jtmcdole
marked this pull request as ready for review
September 16, 2026 17:02
Member
Author
|
To follow up on this: https://github.com/flutter/rfc/actions/runs/35031510826/job/104590851145?pr=21
Some more changes I think I'll make:
|
1. only execute tools from tools folder (working folder considered safe) 2. update assigner to take target directory 3. reduce global permissions in each file 4. read files in as bash array and use possix `-- <rest>` 5. percent encode messages to github
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.
allow-unsafe-pr-checkout: trueon the isolatedtarget/sparse checkout step to opt intoactions/checkoutv7's fork safety check.gh auth setup-gitusingFLUTTERACTIONSBOT_RFC_TOKEN(with fallback toGITHUB_TOKEN) so commits can be pushed to fork PR branches where maintainer edits are enabled.rfc-assigned) atomically before pushing changes sorfc-lintpasses on the triggeredsynchronizeevent.permissions: {}to enforce least-privilege defaults.dart run bin/assign_rfc_number.dartinstructions when pushing to a fork fails.Pre-launch Checklist
design doc.dart run bin/assign_rfc_number.dartlocally when instructed).