From 9e0a0f887bd149bc8ddc9998ca28f812a85933ae Mon Sep 17 00:00:00 2001 From: Micah Abbott Date: Thu, 26 Jun 2025 14:27:23 -0400 Subject: [PATCH] ci: periodically run update-generated This introduces a GitHub workflow to periodically run `cargo xtask update-generated` in order to keep the docs up-to-date with the latest changes. It will create a PR if changes are detected. Signed-off-by: Micah Abbott --- .github/workflows/udpate-generated.yml | 52 ++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/udpate-generated.yml diff --git a/.github/workflows/udpate-generated.yml b/.github/workflows/udpate-generated.yml new file mode 100644 index 000000000..0a3620e90 --- /dev/null +++ b/.github/workflows/udpate-generated.yml @@ -0,0 +1,52 @@ +name: 'Update Generated Files' + +# This workflow is triggered on a schedule (every day at 3:15 AM UTC) +# and can also be triggered manually from the GitHub Actions UI. +on: + workflow_dispatch: + schedule: + - cron: '15 3 * * *' + +jobs: + update-and-pr: + name: 'Update Generated Files and Create PR' + runs-on: ubuntu-latest + container: quay.io/coreos-assembler/fcos-buildroot:testing-devel + steps: + - name: 'Checkout repository' + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 'Mark git directory as safe' + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + shell: bash + + - name: 'Install dependencies' + run: ./ci/installdeps.sh + shell: bash + + - name: 'Install pandoc' + run: dnf -y install pandoc + shell: bash + + - name: 'Update generated docs' + run: cargo xtask update-generated + shell: bash + + - name: 'Create Pull Request' + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: 'chore: Update generated files' + committer: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>' + author: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>' + signoff: true + title: 'docs: Update generated' + body: | + This PR was auto-generated by a GitHub Actions workflow. + + It contains updates to doc files generated by `cargo xtask update-generated`. + branch: 'actions/update-generated-files' + labels: 'documentation' +