File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ generator 49
77[outputs]
88.github/actionlint.yaml ec35f48ae7e90e0e
99.github/ci/project.toml b19da7b7165e2f66
10- .github/workflows/ci-main.yml 7b55f4df4a234985
11- .github/workflows/ci-policy.yml a9a48676140ac8dd
10+ .github/workflows/ci-main.yml 9674edd8e9649bc5
11+ .github/workflows/ci-policy.yml 29d78b9957b5e17f
1212.github/workflows/ci-pr.yml aa0b4d40949af2ad
1313.github/workflows/ci-unit-gradle.yml a8a769d0f75f737d
1414.github/workflows/maintenance.yml 44cdcd6db1e77d43
Original file line number Diff line number Diff line change @@ -176,24 +176,13 @@ jobs:
176176 env :
177177 GH_TOKEN : ${{ github.token }}
178178 DEFAULT_BRANCH : main
179- DECLARED_RULESET_CONTEXTS : DCO,Policy,ci-required
180179 run : |
181180 set -euo pipefail
182- stderr="$(mktemp)"
183- trap 'rm -f "$stderr"' EXIT
184- if contexts="$(gh api "repos/$GITHUB_REPOSITORY/rulesets?includes_parents=true" 2>"$stderr" \
181+ contexts="$(gh api "repos/$GITHUB_REPOSITORY/rulesets?includes_parents=true" \
185182 | jq -r '.[] | select(.target == "branch" and .enforcement == "active") | .id' \
186183 | while read -r id; do gh api "repos/$GITHUB_REPOSITORY/rulesets/$id"; done \
187184 | jq -r --arg branch "refs/heads/$DEFAULT_BRANCH" 'select(.conditions.ref_name.include | any(. == "~DEFAULT_BRANCH" or . == "~ALL" or . == $branch)) | .rules[] | select(.type == "required_status_checks") | .parameters.required_status_checks[].context' \
188- | sort -u | paste -sd, -)"; then
189- :
190- elif grep -qE '(HTTP 403|Upgrade to GitHub Team)' "$stderr"; then
191- echo "::warning::rulesets API returned 403; falling back to declared contexts [$DECLARED_RULESET_CONTEXTS]"
192- contexts="$DECLARED_RULESET_CONTEXTS"
193- else
194- cat "$stderr" >&2
195- exit 1
196- fi
185+ | sort -u | paste -sd, -)"
197186 echo "RULESET_CONTEXTS=$contexts" >> "$GITHUB_ENV"
198187 - name : Enforce workflow policy
199188 env :
Original file line number Diff line number Diff line change @@ -80,24 +80,13 @@ jobs:
8080 env :
8181 GH_TOKEN : ${{ github.token }}
8282 DEFAULT_BRANCH : main
83- DECLARED_RULESET_CONTEXTS : DCO,Policy,ci-required
8483 run : |
8584 set -euo pipefail
86- stderr="$(mktemp)"
87- trap 'rm -f "$stderr"' EXIT
88- if contexts="$(gh api "repos/$GITHUB_REPOSITORY/rulesets?includes_parents=true" 2>"$stderr" \
85+ contexts="$(gh api "repos/$GITHUB_REPOSITORY/rulesets?includes_parents=true" \
8986 | jq -r '.[] | select(.target == "branch" and .enforcement == "active") | .id' \
9087 | while read -r id; do gh api "repos/$GITHUB_REPOSITORY/rulesets/$id"; done \
9188 | jq -r --arg branch "refs/heads/$DEFAULT_BRANCH" 'select(.conditions.ref_name.include | any(. == "~DEFAULT_BRANCH" or . == "~ALL" or . == $branch)) | .rules[] | select(.type == "required_status_checks") | .parameters.required_status_checks[].context' \
92- | sort -u | paste -sd, -)"; then
93- :
94- elif grep -qE '(HTTP 403|Upgrade to GitHub Team)' "$stderr"; then
95- echo "::warning::rulesets API returned 403; falling back to declared contexts [$DECLARED_RULESET_CONTEXTS]"
96- contexts="$DECLARED_RULESET_CONTEXTS"
97- else
98- cat "$stderr" >&2
99- exit 1
100- fi
89+ | sort -u | paste -sd, -)"
10190 echo "RULESET_CONTEXTS=$contexts" >> "$GITHUB_ENV"
10291 - name : Enforce workflow policy
10392 env :
You can’t perform that action at this time.
0 commit comments