-
Notifications
You must be signed in to change notification settings - Fork 209
ci: periodically run update-generated #1386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
When I tested this in my fork, it correctly created a PR that looked like #1385 Hmm...I should apply those changes to my
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ohh hmm, then maybe some of these FCOS actions have been unnecessarily doing a diff? Either way thanks so much for testing this out!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like my understanding was correct; after applying the generated changes to my https://github.com/miabbott/bootc/actions/runs/15917569924/job/44897979972
In the example you linked, I think you could simplify the "Check if there are new commits" step to just do a |
||
| 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' | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option would be to have this fire on every push to
mainThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.