File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 go-version-file : ' go.mod'
2626 id : go
2727 - name : Run go-apidiff
28+ id : check-api
29+ continue-on-error : true
2830 uses : joelanford/go-apidiff@main
31+ - name : Check for override label
32+ if : ${{ steps.check-api.outcome == 'failure' }}
33+ run : |
34+ if gh api repos/$OWNER/$REPO/pulls/$PR --jq '.labels.[].name' | grep -q "${OVERRIDE_LABEL}"; then
35+ echo "Found ${OVERRIDE_LABEL} label, overriding failed results."
36+ exit 0
37+ else
38+ echo "No ${OVERRIDE_LABEL} label found, failing the job."
39+ exit 1
40+ fi
41+ env :
42+ GH_TOKEN : ${{ github.token }}
43+ OWNER : ${{ github.repository_owner }}
44+ REPO : ${{ github.event.repository.name }}
45+ PR : ${{ github.event.pull_request.number }}
46+ OVERRIDE_LABEL : " go-apidiff-override"
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: go-verdiff
22on :
33 pull_request :
44 branches :
5- - master
5+ - master
66jobs :
77 go-verdiff :
88 runs-on : ubuntu-latest
@@ -11,12 +11,24 @@ 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 : ${{ 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+ else
26+ echo "No ${OVERRIDE_LABEL} label found, failing the job."
27+ exit 1
28+ fi
1829 env :
1930 GH_TOKEN : ${{ github.token }}
2031 OWNER : ${{ github.repository_owner }}
2132 REPO : ${{ github.event.repository.name }}
2233 PR : ${{ github.event.pull_request.number }}
34+ OVERRIDE_LABEL : " go-verdiff-override"
Original file line number Diff line number Diff line change 6363GO_MAJOR=${MAX_VER[0]}
6464GO_MINOR=${MAX_VER[1]}
6565GO_PATCH=${MAX_VER[2]}
66- OVERRIDE_LABEL=" override-go-verdiff"
6766
6867RETCODE=0
6968
@@ -135,19 +134,4 @@ for f in $(find . -name "*.mod"); do
135134 fi
136135done
137136
138- for l in ${LABELS} ; do
139- if [ " $l " == " ${OVERRIDE_LABEL} " ]; then
140- if [ ${RETCODE} -eq 1 ]; then
141- echo " "
142- echo " Found ${OVERRIDE_LABEL} label, overriding failed results."
143- RETCODE=0
144- fi
145- fi
146- done
147-
148- if [ ${RETCODE} -eq 1 ]; then
149- echo " "
150- echo " This test result may be overridden by applying the (${OVERRIDE_LABEL} ) label to this PR and re-running the CI job."
151- fi
152-
153137exit ${RETCODE}
You can’t perform that action at this time.
0 commit comments