ci: periodically run update-generated#1386
Conversation
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 <miabbott@redhat.com>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
I put this together with some help from Gemini. I don't know if auto-generated PRs are desired in this repo, so feel free to close it if not. |
| run: cargo xtask update-generated | ||
| shell: bash | ||
|
|
||
| - name: 'Create Pull Request' |
There was a problem hiding this comment.
I think this is missing a step like https://github.com/coreos/fedora-coreos-config/blob/ba564a93c463f9bd051cf3333822138f38bf0a69/.github/workflows/bump-fedora-bootc.yaml#L36 to do a diff right?
There was a problem hiding this comment.
Based on my read of how the action behaves, it will silently exit if there are no changes detected - https://github.com/peter-evans/create-pull-request?tab=readme-ov-file#action-behaviour
How the action behaves:
- If there are changes (i.e. a diff exists with the checked-out base branch), the changes will be pushed to a new branch and a pull request created.
- If there are no changes (i.e. no diff exists with the checked-out base branch), no pull request will be created and the action exits silently.
When I tested this in my fork, it correctly created a PR that looked like #1385
Hmm...I should apply those changes to my main branch and see if the action just no-ops. Will report back here with results!
There was a problem hiding this comment.
Ohh hmm, then maybe some of these FCOS actions have been unnecessarily doing a diff? Either way thanks so much for testing this out!
There was a problem hiding this comment.
Looks like my understanding was correct; after applying the generated changes to my main branch, the next time I ran the action there was no PR generated.
https://github.com/miabbott/bootc/actions/runs/15917569924/job/44897979972
Ohh hmm, then maybe some of these FCOS actions have been unnecessarily doing a diff?
In the example you linked, I think you could simplify the "Check if there are new commits" step to just do a git submodule update. If there was a new submodule commit, the PR action would generate the PR otherwise it would no-op.
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: '15 3 * * *' |
There was a problem hiding this comment.
Another option would be to have this fire on every push to main
on:
push:
branches:
- main
There was a problem hiding this comment.
That said, we could also just do this as a check on PRs and require the submitter to do it...
But yeah since you already wrote it this way I'm fine to run with it for now.
This introduces a GitHub workflow to periodically run
cargo xtask update-generatedin 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 miabbott@redhat.com