diff --git a/.github/workflows/update-crds.yml b/.github/workflows/update-crds.yml index 50510ea47..30456005f 100644 --- a/.github/workflows/update-crds.yml +++ b/.github/workflows/update-crds.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Rust uses: dtolnay/rust-toolchain@stable - name: Cache Dependencies @@ -23,6 +25,13 @@ jobs: run: kopium --version - name: Generate Resources run: ./code-generator/generate.sh + - name: Fix changed CRDs + run: | + for module in $(git diff --name-only origin/main -- ./kube-custom-resources-rs/src | grep --invert-match lib.rs | xargs --no-run-if-empty -I{} dirname {} | sort --unique | xargs --no-run-if-empty -I{} basename {}); do + if [ -f "./kube-custom-resources-rs/src/${module}/mod.rs" ]; then + ./code-generator/fix-cargo-warnings.sh "${module}" + fi + done - id: cpr name: Create Pull Request uses: peter-evans/create-pull-request@v5