Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions components/managed-files-guard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ Two properties of that ride are deliberate:
- **Failure behavior:** the action fails closed on an unreadable diff or an
unresolvable manifest, no-ops when the repository is not a manifest target,
and needs only `contents: read` (standards is public; the checkout of it
uses the job's ambient token with `persist-credentials: false`).
uses the job's ambient token with `persist-credentials: false`) and
`pull-requests: read` (the action lists the pull request's commits to
skip pull requests whose every commit is Dependabot's).
- **The `actions/checkout` pin.** Unlike the Claude lane callers, this file
carries a third-party action pin, and two consequences follow. In this
repository, Dependabot's `github-actions` ecosystem scans
Expand All @@ -252,7 +254,8 @@ Two properties of that ride are deliberate:
`managed-files-guard.test.sh` asserts, against the parsed YAML of each file:
the `pull_request` trigger with the default `types` and a `paths` list equal
to the managed union of the targets that receive that file, free of glob
metacharacters; `contents: read` as the whole grant; the
metacharacters; `contents: read` and `pull-requests: read` as the whole
grant; the
canonical `concurrency-policy` block and nothing else in it; one job on its
literal label with a 10-minute timeout, calling no reusable workflow; a
full-history, credential-free checkout pinned like the sibling workflows; the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ on:

permissions:
contents: read
pull-requests: read

# Canonical block from the standards `concurrency-policy` component: a newer
# push to the same pull request cancels the in-flight guard run; the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ check_shape() {
"$(managed_union "$destination")" "$(q '.on.pull_request.paths[]')"
assert_silent "$p no paths entry carries a glob metacharacter" \
"$(q '.on.pull_request.paths[]' | grep -E '[][*?+!]' || true)"
assert_eq "$p workflow token is contents: read and nothing else" 'contents=read' \
assert_eq "$p workflow token is contents: read and pull-requests: read and nothing else" 'contents=read,pull-requests=read' \
"$(q '.permissions | to_entries | map(.key + "=" + .value) | join(",")')"

assert_eq "$p concurrency group is the canonical concurrency-policy expression" \
Expand Down
1 change: 1 addition & 0 deletions components/managed-files-guard/managed-files-guard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ on:

permissions:
contents: read
pull-requests: read

# Canonical block from the standards `concurrency-policy` component: a newer
# push to the same pull request cancels the in-flight guard run; the
Expand Down
Loading