Skip to content

Conversation

joshcooper
Copy link
Contributor

When a commit is pushed to main, build all of the references, including man pages. If the only changes are due to SHA and dates, then do nothing. Otherwise, commit all of the references and man pages.

The action is only triggered when a commit is pushed to main, but not on pull requests so that we don't have to worry about untrusted inputs.

The action is only triggered when the repo owner is puppetlabs, so it won't trigger on forks.

The action uses full SHAs for the pandoc and add-and-commit actions.

If changes are detected, the action creates a commit whose author is GitHub Actions [email protected] with message:

Update references [no-promote]

And pushes the commit to the main branch. It uses the repository's GITHUB_TOKEN to accomplish this. We don't need to worry about recursive workflow runs[1]:

When you use the repository's GITHUB_TOKEN to perform tasks, events
triggered by the GITHUB_TOKEN ... will not create a new workflow run. This
prevents you from accidentally creating recursive workflow runs.

[1] https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow

When a commit is pushed to main, build all of the references, including man
pages. If the only changes are due to SHA and dates, then do nothing. Otherwise,
commit all of the references and man pages.

The action is only triggered when a commit is pushed to main, but not on pull
requests so that we don't have to worry about untrusted inputs.

The action is only triggered when the repo owner is puppetlabs, so it won't
trigger on forks.

The action uses full SHAs for the pandoc and add-and-commit actions.

If changes are detected, the action creates a commit whose author is GitHub
Actions <[email protected]> with message:

    Update references [no-promote]

And pushes the commit to the main branch. It uses the repository's GITHUB_TOKEN
to accomplish this. We don't need to worry about recursive workflow runs[1]:

    When you use the repository's GITHUB_TOKEN to perform tasks, events
    triggered by the GITHUB_TOKEN ... will not create a new workflow run. This
    prevents you from accidentally creating recursive workflow runs.

[1] https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow
@joshcooper
Copy link
Contributor Author

joshcooper commented Sep 5, 2024

I tested this out as best I could on my puppet fork.

This run detected no changes were necessary. From the branch history you can see that no automated commits were made between e5b8639 and 39b98ed.

This run detected man/man5/pupet.conf.5 and references/configuration.md were modified and pushed commit joshcooper@d0df47a166.

@joshcooper joshcooper marked this pull request as ready for review September 6, 2024 05:03
@joshcooper joshcooper requested a review from a team as a code owner September 6, 2024 05:03
@joshcooper joshcooper added the maintenance Maintenance chores are excluded from changelogs label Sep 6, 2024
@mhashizume mhashizume merged commit 7cc46f7 into puppetlabs:main Sep 10, 2024
10 checks passed
@mhashizume
Copy link
Contributor

@joshcooper It looks like this failed due to branch protections: https://github.com/puppetlabs/puppet/actions/runs/10800909036/job/29959927892

I assume we can add an exemption, but I'm not sure that the user that pushes to main is able to do that. Maybe we need to try having another user be the one that pushes?

@joshcooper joshcooper deleted the references_ci branch October 10, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance chores are excluded from changelogs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants