creyD/prettier_action

[BUG] Other GitHub actions freeze if prettier job adds new commit

Closed this issue · 2 comments

What exactly happened?
If prettier job successfully runs and adds commit with lint changes, other GitHub actions freeze and do not complete.

Steps to reproduce the behavior:

  1. Add (malformatted) staged files and submit commit
  2. Prettier job adds edited commit message
  3. GitHub action checks pause forever.

What should've happened?
Job should have successfully run and other GitHub actions should not have halted.

creyD commented

Thanks for the report! Is this something we can influence or fix? I will ask the GitHub support for this.

creyD commented

From GitHub support:

If the action creyD/prettier_action is adding commits back to the repository using the GITHUB_TOKEN, these commits won't themselves trigger workflow runs:

https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret

When you use the repository's GITHUB_TOKEN to perform tasks on behalf of the GitHub Actions app, events triggered by the GITHUB_TOKEN will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs. For example, if a workflow run pushes code using the repository's GITHUB_TOKEN, a new workflow will not run even when the repository contains a workflow configured to run when push events occur.

I suspect this is what is happening in this case. They'll need to use a Personal Access Token(PAT) if they intend for subsequent commits made within the workflow to trigger other runs.