Skip to content

Commit ecec490

Browse files
authored
Add override labeling for go-apidiff (#2565)
Signed-off-by: Todd Short <tshort@redhat.com>
1 parent 147cfa8 commit ecec490

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/go-apidiff.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,22 @@ jobs:
1616
go-version-file: go.mod
1717

1818
- uses: joelanford/go-apidiff@main
19+
id: check-api
20+
continue-on-error: true
21+
22+
- name: Check for override label
23+
if: ${{ steps.check-api.outcome == 'failure' }}
24+
run: |
25+
if gh api repos/$OWNER/$REPO/pulls/$PR --jq '.labels.[].name' | grep -q "${OVERRIDE_LABEL}"; then
26+
echo "Found ${OVERRIDE_LABEL} label, overriding failed results."
27+
exit 0
28+
else
29+
echo "No ${OVERRIDE_LABEL} label found, failing the job."
30+
exit 1
31+
fi
32+
env:
33+
GH_TOKEN: ${{ github.token }}
34+
OWNER: ${{ github.repository_owner }}
35+
REPO: ${{ github.event.repository.name }}
36+
PR: ${{ github.event.pull_request.number }}
37+
OVERRIDE_LABEL: "go-apidiff-override"

0 commit comments

Comments
 (0)