Skip to content

Commit

Permalink
Merge pull request #669 from Iceber/verify_forked_code
Browse files Browse the repository at this point in the history
use a separate action to validate the forked code
  • Loading branch information
Iceber authored Jun 13, 2024
2 parents 772b284 + 0500e98 commit 524238d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 22 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Verify
on:
push:
paths:
- 'vendor/k8s.io/client-go/tools/cache/reflector.go'
- 'vendor/k8s.io/client-go/tools/pager/pager.go'
jobs:
verify-forked-code:
name: Verify Forked Code
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.WORKSPACE }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- run: hack/verify-forked-code.sh
27 changes: 27 additions & 0 deletions hack/verify-forked-code.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

reflector=0
diff vendor/k8s.io/client-go/tools/cache/reflector.go pkg/synchromanager/clustersynchro/informer/cache/.reflector.go || reflector=$?

if [[ $reflector -eq 0 ]]
then
echo "'reflector.go' is up to date."
else
echo "the file 'reflector.go' in vendor has been changed, please update the 'cache/.reflector.go' and 'reflector.go' in the pkg/synchromanager/clustersynchro/informer"
exit 1
fi

pager=0
diff vendor/k8s.io/client-go/tools/pager/pager.go pkg/synchromanager/clustersynchro/informer/pager/.pager.go.copy || pager=$?

if [[ $pager -eq 0 ]]
then
echo "'pager.go' is up to date."
else
echo "the file 'pager.go' in vendor has been changed, please update the '.pager.go.copy' and 'pager.go' in the pkg/synchromanager/clustersynchro/informer/pager"
exit 1
fi
22 changes: 0 additions & 22 deletions hack/verify-vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,3 @@ else
echo "${DIFFROOT}, 'go.mod' or 'go.sum' is out of date. Please run 'make vendor'"
exit 1
fi

reflector=0
diff vendor/k8s.io/client-go/tools/cache/reflector.go pkg/synchromanager/clustersynchro/informer/cache/.reflector.go || reflector=$?

if [[ $reflector -eq 0 ]]
then
echo "'reflector.go' is up to date."
else
echo "the file 'reflector.go' in vendor has been changed, please update the 'cache/.reflector.go' and 'reflector.go' in the pkg/synchromanager/clustersynchro/informer"
exit 1
fi

pager=0
diff vendor/k8s.io/client-go/tools/pager/pager.go pkg/synchromanager/clustersynchro/informer/pager/.pager.go.copy || pager=$?

if [[ $pager -eq 0 ]]
then
echo "'pager.go' is up to date."
else
echo "the file 'pager.go' in vendor has been changed, please update the '.pager.go.copy' and 'pager.go' in the pkg/synchromanager/clustersynchro/informer/pager"
exit 1
fi

0 comments on commit 524238d

Please sign in to comment.