Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use a separate action to validate the forked code #669

Merged
merged 1 commit into from
Jun 13, 2024
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
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
Loading