3ware / workflows

Reusable workflow repository
MIT License
0 stars 1 forks source link

terraform-docs workflow loop #28

Closed chris3ware closed 1 year ago

chris3ware commented 1 year ago

The terraform-docs workflow currently pushes commits with a token generated by the 3ware-release app. This is causing a workflow loop because terraform-docs is also triggered, which pushes a new commit, which triggers .... ad infinitum.

Adding [skip ci] does not solve this problem because then required_status_checks are not run. More detail here:

https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs

You won't be able to merge the pull request if your repository is configured to require specific checks to pass first. To allow the pull request to be merged you can push a new commit to the pull request without the skip instruction in the commit message.

The solution is to use GITHUB_TOKEN, because it provides protection against such loops:

https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow

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

3ware-release[bot] commented 1 year ago

This issue has been resolved in version 1.6.0