Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/crd-diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,29 @@ jobs:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Run make verify-crd-compatibility
id: verify-crd-compatibility
continue-on-error: true
run: |
make verify-crd-compatibility \
CRD_DIFF_ORIGINAL_REF="git://${{ github.event.pull_request.base.sha }}?path=" \
CRD_DIFF_UPDATED_REF="git://${{ github.event.pull_request.head.sha }}?path="
- name: Check for override label
if: ${{ steps.verify-crd-compatibility.outcome == 'failure' }}
run: |
if gh api repos/$OWNER/$REPO/pulls/$PR --jq '.labels.[].name' | grep -q "${OVERRIDE_LABEL}"; then
echo "Found ${OVERRIDE_LABEL} label, overriding failed results."
exit 0
else
echo "No ${OVERRIDE_LABEL} label found, failing the job."
exit 1
fi
env:
GH_TOKEN: ${{ github.token }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
PR: ${{ github.event.pull_request.number }}
OVERRIDE_LABEL: "crd-diff-override"
14 changes: 13 additions & 1 deletion .github/workflows/go-verdiff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,24 @@ jobs:
with:
fetch-depth: 0
- name: Check golang version
id: check-version
continue-on-error: true
run: |
export LABELS="$(gh api repos/$OWNER/$REPO/pulls/$PR --jq '.labels.[].name')"
hack/tools/check-go-version.sh -b "${{ github.event.pull_request.base.sha }}"
shell: bash
- name: Check for override label
if: ${{ steps.check-version.outcome == 'failure' }}
run: |
if gh api repos/$OWNER/$REPO/pulls/$PR --jq '.labels.[].name' | grep -q "${OVERRIDE_LABEL}"; then
echo "Found ${OVERRIDE_LABEL} label, overriding failed results."
exit 0
else
echo "No ${OVERRIDE_LABEL} label found, failing the job."
exit 1
fi
env:
GH_TOKEN: ${{ github.token }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
PR: ${{ github.event.pull_request.number }}
OVERRIDE_LABEL: "go-verdiff-override"
16 changes: 0 additions & 16 deletions hack/tools/check-go-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ fi
GO_MAJOR=${MAX_VER[0]}
GO_MINOR=${MAX_VER[1]}
GO_PATCH=${MAX_VER[2]}
OVERRIDE_LABEL="override-go-verdiff"

RETCODE=0

Expand Down Expand Up @@ -118,19 +117,4 @@ for f in $(find . -name "*.mod"); do
fi
done

for l in ${LABELS}; do
if [ "$l" == "${OVERRIDE_LABEL}" ]; then
if [ ${RETCODE} -eq 1 ]; then
echo ""
echo "Found ${OVERRIDE_LABEL} label, overriding failed results."
RETCODE=0
fi
fi
done

if [ ${RETCODE} -eq 1 ]; then
echo ""
echo "This test result may be overridden by applying the (${OVERRIDE_LABEL}) label to this PR and re-running the CI job."
fi

exit ${RETCODE}