Skip to content

Commit

Permalink
feat: check PRs for spec changes
Browse files Browse the repository at this point in the history
  • Loading branch information
3benbox committed Jan 31, 2024
1 parent 845ff30 commit 2605236
Show file tree
Hide file tree
Showing 2 changed files with 634 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/spec-change.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Spec change check

on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]
push:

jobs:
check:
runs-on: ubuntu-latest
# Skip this job if the PR has the `spec-change` label
if: ${{ !contains(github.event.pull_request.labels.*.name, 'spec-change') }}

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: check for spec changes
run: |
cargo run --bin crdgen > crdgen.yaml
diff crdgen.yaml ./k8s/crds/v1alpha1.yaml > diff.txt
if [ -s diff.txt ]; then
echo "Files are different"
echo "::set-output name=DIFF::$(cat diff.txt)"
exit 1
else
echo "no diff"
fi
Loading

0 comments on commit 2605236

Please sign in to comment.