Update CRDs #6
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
# SPDX-FileCopyrightText: The kube-custom-resources-rs Authors | |
# SPDX-License-Identifier: 0BSD | |
name: Update CRDs | |
on: | |
schedule: | |
- cron: 53 9 * * FRI | |
workflow_dispatch: | |
jobs: | |
update: | |
name: Update CRDs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Install kopium | |
run: cargo install kopium | |
- name: Verify kopium | |
run: kopium --version | |
- name: Generate Resources | |
run: ./code-generator/generate.sh | |
- name: Fix changed CRDs | |
run: | | |
for feature 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/${feature}/mod.rs" ]; then | |
./code-generator/fix-cargo-warnings.sh "${feature}" | |
fi | |
done | |
- id: cpr | |
name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.PAT }} | |
commit-message: Update upstream specifications to their latest version | |
committer: GitHub <[email protected]> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
title: Update upstream specifications to their latest version | |
body: Automated changes by the [Update CRDs](https://github.com/metio/kube-custom-resources-rs/blob/main/.github/workflows/update-crds.yml) GitHub action | |
labels: enhancement | |
assignees: sebhoss | |
draft: false | |
base: main | |
branch: update-specs | |
delete-branch: true | |
- id: automerge | |
name: Enable Pull Request Automerge | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
run: gh pr merge --rebase --auto "${{ steps.cpr.outputs.pull-request-number }}" | |
env: | |
GH_TOKEN: ${{ secrets.PAT }} |