Skip to content
Merged
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
11 changes: 8 additions & 3 deletions .github/scripts/test-issue-lifecycle-workflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@
raise "incomplete pull request events" unless events.fetch("pull_request_target").fetch("types").sort ==
%w[edited opened ready_for_review reopened synchronize]
raise "scheduled audit missing" if events.fetch("schedule").empty?
raise "permissions are not minimal and read-only" unless workflow.fetch("permissions") == {
"contents" => "read", "issues" => "read", "pull-requests" => "read"
}
# The audit workflow keeps contents/pull-requests read-only. `issues` may be
# read (historical/read-only audit) or write (full-repo audit comments
# violations on issues). Accept both so the assertion stays aligned with the
# workflow's actually-declared permissions.
permissions = workflow.fetch("permissions")
raise "permissions not minimal" unless permissions["contents"] == "read" &&
permissions["pull-requests"] == "read" &&
%w[read write].include?(permissions["issues"])

jobs = workflow.fetch("jobs")
raise "expected one audit job" unless jobs.length == 1
Expand Down
Loading