@@ -58,11 +58,11 @@ jobs:
5858 persist-credentials : false
5959 - name : Set up Velnor workflow runtime
6060 if : ${{ runner.environment == 'github-hosted' }}
61- uses : tailrocks/velnor/.github/actions/setup-velnor-workflow@92c3478694ef423fb4160b8c934d6671ca85b51a
61+ uses : tailrocks/velnor/.github/actions/setup-velnor-workflow@b9c3156cdb88e63c11b9e595a3e694b02238c09a
6262 with :
63- rev : 92c3478694ef423fb4160b8c934d6671ca85b51a
63+ rev : b9c3156cdb88e63c11b9e595a3e694b02238c09a
6464 - name : Set trusted workflow policy revision
65- run : echo "VELNOR_WORKFLOW_POLICY_REVISION=92c3478694ef423fb4160b8c934d6671ca85b51a " >> "$GITHUB_ENV"
65+ run : echo "VELNOR_WORKFLOW_POLICY_REVISION=b9c3156cdb88e63c11b9e595a3e694b02238c09a " >> "$GITHUB_ENV"
6666 - name : Select affected units
6767 id : plan
6868 env :
7979 - name : Prepare Velnor workflow runtime
8080 shell : bash
8181 env :
82- EXPECTED_REVISION : 92c3478694ef423fb4160b8c934d6671ca85b51a
82+ EXPECTED_REVISION : b9c3156cdb88e63c11b9e595a3e694b02238c09a
8383 run : |
8484 set -euo pipefail
8585 stage="$RUNNER_TEMP/velnor-workflow-runtime"
9797 - name : Publish Velnor workflow runtime
9898 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
9999 with :
100- name : velnor-workflow-runtime-92c3478694ef423fb4160b8c934d6671ca85b51a -${{ runner.os }}-${{ runner.arch }}
100+ name : velnor-workflow-runtime-b9c3156cdb88e63c11b9e595a3e694b02238c09a -${{ runner.os }}-${{ runner.arch }}
101101 path : ${{ runner.temp }}/velnor-workflow-runtime
102102 if-no-files-found : error
103103 retention-days : 7
@@ -147,7 +147,7 @@ jobs:
147147 with :
148148 backend : github
149149 version : 1.11.1
150- cache-key : velnor-policy-mbx-1.11.1-${{ runner.os }}-${{ runner.arch }}-92c3478694ef423fb4160b8c934d6671ca85b51a
150+ cache-key : velnor-policy-mbx-1.11.1-${{ runner.os }}-${{ runner.arch }}-b9c3156cdb88e63c11b9e595a3e694b02238c09a
151151 restore-keys : |
152152 velnor-policy-mbx-1.11.1-${{ runner.os }}-${{ runner.arch }}-
153153 - name : Install pinned Velnor workflow runtime
@@ -167,7 +167,7 @@ jobs:
167167 cargo install \
168168 --locked \
169169 --git https://github.com/tailrocks/velnor \
170- --rev 92c3478694ef423fb4160b8c934d6671ca85b51a \
170+ --rev b9c3156cdb88e63c11b9e595a3e694b02238c09a \
171171 --root "$VELNOR_WORKFLOW_ROOT" \
172172 velnor-workflow \
173173 --bin velnor-workflow
@@ -176,20 +176,31 @@ jobs:
176176 env :
177177 GH_TOKEN : ${{ github.token }}
178178 DEFAULT_BRANCH : main
179+ DECLARED_RULESET_CONTEXTS : DCO,Policy,ci-required
179180 run : |
180181 set -euo pipefail
181- contexts="$(gh api "repos/$GITHUB_REPOSITORY/rulesets?includes_parents=true" \
182+ stderr="$(mktemp)"
183+ trap 'rm -f "$stderr"' EXIT
184+ if contexts="$(gh api "repos/$GITHUB_REPOSITORY/rulesets?includes_parents=true" 2>"$stderr" \
182185 | jq -r '.[] | select(.target == "branch" and .enforcement == "active") | .id' \
183186 | while read -r id; do gh api "repos/$GITHUB_REPOSITORY/rulesets/$id"; done \
184187 | 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' \
185- | sort -u | paste -sd, -)"
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
186197 echo "RULESET_CONTEXTS=$contexts" >> "$GITHUB_ENV"
187198 - name : Enforce workflow policy
188199 env :
189200 WORKFLOW_ROOT : ${{ github.workspace }}/policy-checkout
190201 HEAD_SHA : ${{ github.event.pull_request.head.sha || github.sha }}
191202 BASE_SHA : ${{ github.event.pull_request.base.sha || github.sha }}
192- VELNOR_WORKFLOW_POLICY_REVISION : 92c3478694ef423fb4160b8c934d6671ca85b51a
203+ VELNOR_WORKFLOW_POLICY_REVISION : b9c3156cdb88e63c11b9e595a3e694b02238c09a
193204 run : |
194205 set -euo pipefail
195206 velnor-workflow policy \
0 commit comments