Skip to content
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

Merged
merged 14 commits into from
Nov 22, 2023
Merged

Conversation

npalm
Copy link
Member

@npalm npalm commented Nov 17, 2023

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.

@npalm npalm requested a review from koendelaat November 17, 2023 10:25
Copy link
Collaborator

@koendelaat koendelaat left a 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

  1. Don't update docs on the main branch
  2. 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 }}

@npalm
Copy link
Member Author

npalm commented Nov 20, 2023

@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.

@npalm npalm requested a review from koendelaat November 20, 2023 06:32
.github/workflows/update-docs.yml Outdated Show resolved Hide resolved
.github/workflows/update-docs.yml Show resolved Hide resolved
@npalm npalm marked this pull request as draft November 20, 2023 06:42
@npalm npalm marked this pull request as ready for review November 22, 2023 11:14
@npalm npalm requested a review from koendelaat November 22, 2023 11:14
@npalm npalm merged commit 13b1894 into main Nov 22, 2023
36 checks passed
@npalm npalm deleted the npalm/docs-fix branch November 22, 2023 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants