Skip to content

Commit 2605236

Browse files
committed
feat: check PRs for spec changes
1 parent 845ff30 commit 2605236

File tree

2 files changed

+634
-0
lines changed

2 files changed

+634
-0
lines changed

Diff for: .github/workflows/spec-change.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Spec change check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, labeled, unlabeled]
6+
push:
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
# Skip this job if the PR has the `spec-change` label
12+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'spec-change') }}
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: dtolnay/rust-toolchain@stable
17+
- name: check for spec changes
18+
run: |
19+
cargo run --bin crdgen > crdgen.yaml
20+
diff crdgen.yaml ./k8s/crds/v1alpha1.yaml > diff.txt
21+
if [ -s diff.txt ]; then
22+
echo "Files are different"
23+
echo "::set-output name=DIFF::$(cat diff.txt)"
24+
exit 1
25+
else
26+
echo "no diff"
27+
fi
28+

0 commit comments

Comments
 (0)