File tree Expand file tree Collapse file tree 3 files changed +25
-19
lines changed
Expand file tree Collapse file tree 3 files changed +25
-19
lines changed Original file line number Diff line number Diff line change 88 - uses : actions/checkout@v6
99 with :
1010 fetch-depth : 0
11-
1211 - uses : actions/setup-go@v6
1312 with :
1413 go-version-file : go.mod
15-
1614 - name : Run make verify-crd-compatibility
15+ id : verify-crd-compatibility
16+ continue-on-error : true
1717 run : |
1818 make verify-crd-compatibility \
1919 CRD_DIFF_ORIGINAL_REF="git://${{ github.event.pull_request.base.sha }}?path=" \
2020 CRD_DIFF_UPDATED_REF="git://${{ github.event.pull_request.head.sha }}?path="
21+ - name : Check for override label
22+ if : ${{ failure() && steps.verify-crd-compatibility.outcome == 'failure' }}
23+ run : |
24+ if gh api repos/$OWNER/$REPO/pulls/$PR --jq '.labels.[].name' | grep -q "${OVERRIDE_LABEL}"; then
25+ echo "Found ${OVERRIDE_LABEL} label, overriding failed results."
26+ exit 0
27+ fi
28+ env :
29+ GH_TOKEN : ${{ github.token }}
30+ OWNER : ${{ github.repository_owner }}
31+ REPO : ${{ github.event.repository.name }}
32+ PR : ${{ github.event.pull_request.number }}
33+ OVERRIDE_LABEL : " crd-diff-override"
Original file line number Diff line number Diff line change @@ -11,12 +11,21 @@ jobs:
1111 with :
1212 fetch-depth : 0
1313 - name : Check golang version
14+ id : check-version
15+ continue-on-error : true
1416 run : |
15- export LABELS="$(gh api repos/$OWNER/$REPO/pulls/$PR --jq '.labels.[].name')"
1617 hack/tools/check-go-version.sh -b "${{ github.event.pull_request.base.sha }}"
1718 shell : bash
19+ - name : Check for override label
20+ if : ${{ failure() && steps.check-version.outcome == 'failure' }}
21+ run : |
22+ if gh api repos/$OWNER/$REPO/pulls/$PR --jq '.labels.[].name' | grep -q "${OVERRIDE_LABEL}"; then
23+ echo "Found ${OVERRIDE_LABEL} label, overriding failed results."
24+ exit 0
25+ fi
1826 env :
1927 GH_TOKEN : ${{ github.token }}
2028 OWNER : ${{ github.repository_owner }}
2129 REPO : ${{ github.event.repository.name }}
2230 PR : ${{ github.event.pull_request.number }}
31+ OVERRIDE_LABEL : " go-verdiff-override"
Original file line number Diff line number Diff line change 4646GO_MAJOR=${MAX_VER[0]}
4747GO_MINOR=${MAX_VER[1]}
4848GO_PATCH=${MAX_VER[2]}
49- OVERRIDE_LABEL=" override-go-verdiff"
5049
5150RETCODE=0
5251
@@ -118,19 +117,4 @@ for f in $(find . -name "*.mod"); do
118117 fi
119118done
120119
121- for l in ${LABELS} ; do
122- if [ " $l " == " ${OVERRIDE_LABEL} " ]; then
123- if [ ${RETCODE} -eq 1 ]; then
124- echo " "
125- echo " Found ${OVERRIDE_LABEL} label, overriding failed results."
126- RETCODE=0
127- fi
128- fi
129- done
130-
131- if [ ${RETCODE} -eq 1 ]; then
132- echo " "
133- echo " This test result may be overridden by applying the (${OVERRIDE_LABEL} ) label to this PR and re-running the CI job."
134- fi
135-
136120exit ${RETCODE}
You can’t perform that action at this time.
0 commit comments