-
-
Notifications
You must be signed in to change notification settings - Fork 8
37 lines (30 loc) · 977 Bytes
/
check-bundle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Bundle
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
bundle-check-changed:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Install operator-sdk
run: hack/install_operator-sdk.sh
- name: Generate bundle
run: make bundle
- name: Check if there are changes
id: changes
run: |
if [[ $(git diff --quiet -I'^ createdAt: ' bundle) ]]; then echo "changed=true" >> $GITHUB_OUTPUT; else echo "changed=false" >> $GITHUB_OUTPUT; fi
- name: Bundle files changed, failed run
if: steps.changes.outputs.changed == 'true'
uses: actions/github-script@v7
with:
script: |
core.setFailed('Files changed in bundle generation. Please run `make bundle` and commit.')