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
4 changes: 3 additions & 1 deletion .github/workflows/pr-review-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@ jobs:
# The model jobs narrow this to contents: read and pull-requests: read;
# only the reusable's status job (the claude-review-status check) writes.
permissions:
actions: read # the reusable's check-key-credit job reads this
# workflow's runs for the key's recent credit stop
contents: read
pull-requests: write # the review, its inline comments and the lane's
# reviewed-head marker comment
uses: melodic-software/ci-workflows/.github/workflows/pr-review-cli.yml@4c531cea137f5cbb38d4c132dbfa6e38f76fba7d # v0.65.7
uses: melodic-software/ci-workflows/.github/workflows/pr-review-cli.yml@4f79cc9244498ae856504cf74aeeb05dcc9c6b43 # v0.65.8
with:
lane: code
publish: comments
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pr-review-security-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ jobs:
# The model jobs narrow this to contents: read and pull-requests: read;
# only the reusable's status job (the security-review check) writes.
permissions:
actions: read # the reusable's check-key-credit job reads this
# workflow's runs for the key's recent credit stop
contents: read
pull-requests: write # the review, its inline comments and the lane's
# reviewed-head marker comment
uses: melodic-software/ci-workflows/.github/workflows/pr-review-cli.yml@4c531cea137f5cbb38d4c132dbfa6e38f76fba7d # v0.65.7
uses: melodic-software/ci-workflows/.github/workflows/pr-review-cli.yml@4f79cc9244498ae856504cf74aeeb05dcc9c6b43 # v0.65.8
with:
lane: security
publish: comments
Expand Down
13 changes: 10 additions & 3 deletions scripts/ci-review-lanes.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,17 @@ for pair in 'pr-review-hosted.yml pr-review:' 'pr-review-security-hosted.yml pr-
caller="$ROOT/.github/workflows/$file"
if grep -qxF " $job" "$caller" && grep -qxF ' publish: comments' "$caller" &&
grep -qxF ' hold-label: needs-human' "$caller" &&
grep -qE '^ uses: melodic-software/ci-workflows/\.github/workflows/pr-review-cli\.yml@4c531cea137f5cbb38d4c132dbfa6e38f76fba7d # v0\.65\.7$' "$caller"; then
ok "$file calls pr-review-cli v0.65.7 as job ${job%:} with publish: comments and hold-label: needs-human"
grep -qE '^ uses: melodic-software/ci-workflows/\.github/workflows/pr-review-cli\.yml@4f79cc9244498ae856504cf74aeeb05dcc9c6b43 # v0\.65\.8$' "$caller"; then
ok "$file calls pr-review-cli v0.65.8 as job ${job%:} with publish: comments and hold-label: needs-human"
else
fail "$file lost its job id, publish: comments, hold-label or v0.65.7 pin"
fail "$file lost its job id, publish: comments, hold-label or v0.65.8 pin"
fi
# pr-review-cli's check-key-credit job requests actions: read; a caller that
# does not grant it fails at startup.
if awk -v job=" $job" '$0 == job { on = 1; next } on && /^ [^ ]/ { exit } on && /^ actions: read( |$)/ { found = 1 } END { exit !found }' "$caller"; then
ok "$file grants actions: read to job ${job%:}"
else
fail "$file does not grant actions: read to job ${job%:}"
fi
paths="$(awk '/^ hold-paths: \|$/ { on = 1; next } on && /^ / { sub(/^ +/, ""); print; next } on { exit }' "$caller")"
if [[ "$paths" == $'.github/standards/trusted-actors/**\n.github/actions/check-trusted-trigger/**\n**/CODEOWNERS\n**/.gitmodules' ]]; then
Expand Down
Loading