Repository navigation
ci: label pull requests that touch a sensitive path - #34
Merged
Merged
Conversation
Adds the Memo Labs Sensitive paths workflow: needs-human-review plus one comment naming the matched paths, using the -files pattern of the base .mergify.yml. It never checks out PR code. Refs memolabs-dev/memo-bridge#149
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.
Why
The Mergify policy refuses a PR that touches a sensitive path, but says so only inside the "Mergify Merge Queue" check, and Mergify's own labelling (
pull_request_rules) is a paid feature that is not active (autoloop T-M2b, REQ-M04, memolabs-dev/memo-bridge#149).What
.github/workflows/sensitive-paths.yml: onpull_request_target(opened, reopened, synchronize, ready_for_review), for same-repository PRs only, it-files ~=pattern from.mergify.ymlat the PR's base SHA, through the API, so the label can never disagree with Mergify;needs-human-review(created if missing) and posts one comment naming the paths, updated in place on later pushes.It never checks out or runs PR code; PR data reaches the shell through
env, never through${{ }}in the script. Token permissions:contents: read,issues: write,pull-requests: write, top level{}. The label is informational: Mergify already refuses these PRs, and the label also blocks it (label != needs-human-review).Verification
run:block compared byte for byte with the tested script;bash -npasses.pull_request_targetuses the base branch's copy, so this PR cannot exercise itself. After merge, closing and reopening this repository's negative canary will run it.This PR touches
.github/: the owner merges it.Refs memolabs-dev/memo-bridge#149