[ACM-13577] Onboarded cluster-api (CAPI) component to MCE 2.8 #976
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: RBAC validation | |
on: | |
pull_request: | |
branches: | |
- main | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
rbac-check: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: | |
- '1.22.5' | |
name: Generate role permissions | |
steps: | |
- name: Checkout backplane | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go - ${{ matrix.go }} | |
uses: actions/setup-go@v2 | |
id: go | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Verify modules | |
run: | | |
go mod verify | |
- name: Verify format | |
run: | | |
make fmt | |
git diff --exit-code | |
- name: Set up controller-gen | |
run: | | |
go install sigs.k8s.io/controller-tools/cmd/[email protected] | |
- name: Generate RBAC file | |
run: | | |
go generate | |
- name: Regenerate role | |
run: | | |
controller-gen rbac:roleName=multicluster-engine-operator-role paths="./..." | |
- name: Check if files have changed | |
run: | | |
git diff | |
FILES_CHANGED=$(git diff --name-only | wc -l) | |
if [ "$FILES_CHANGED" != "0" ]; then echo "Remember to run go generate to update rbac"; exit 1; fi; |