-
Notifications
You must be signed in to change notification settings - Fork 628
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
chore: avoid update-docs workflow runs on pushes to main #3617
Conversation
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.
I think there are two options to handle update-docs
on the main
branch
- Don't update docs on the
main
branch - Create a PR when docs need to be updated on the
main
branch
Current suggestion seems to implement both options at the same time, which makes no sense to me. So we either have to skip checking on the main branch (as suggested), but then we should also remove the conditional PR creation step.
Other option could be to fix the PR creation step.
Suggestion:
- name: Create Pull Request (main branch only)
if: github.ref == 'refs/heads/main'
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # ratchet:peter-evans/create-pull-request@v5.0.2
with:
token: ${{ steps.token.outputs.token || secrets.GITHUB_TOKEN }}
commit-message: "Update Terraform docs"
title: "docs: Update Terraform docs"
branch: update-docs
base: ${{ github.ref }}
@koendelaat thx. Updated the workflow. The workflow should now run on any branch in any repo and commit changes. With only an exception for the main branch in this repo. In that case a PR should be opened. |
869d85f
to
9e52fd5
Compare
Docs should be updated on branches, in case of the locked main branch a PR is created. This to ensure the main is up-to-date.