-
Hi all! I’ve found by chance a potential issue on GitHub workflows. Basically if an action performs a commit in the same repo using a Personal Access Token, then the workflow will be triggered again, again, and again… endlessly. I made a demo here: https://github.com/leogr/workflow-loop (ofc I stopped it after a while). I’ve searched around to check if someone is already aware about this, but I found nothing. BTW, what’s the right repo to open this kind of issue? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
This is why we provide workflows with the GITHUB_TOKEN variable. It is explicitly configured to not run subsequent workflows to avoid this sort of behavior. If you had used GITHUB_TOKEN here, you should not have seen a loop. Using a personal access token avoids this check, and will allow you to get into infinite loops if you’re not careful. So this is by-design but it looks like we should clarify this in the documentation - thanks for reporting this! |
Beta Was this translation helpful? Give feedback.
-
Yes, that’s exactly what I guessed too. Side issue: GITHUB_TOKEN has some limitation that PAT does not have (like GitHub pages are not updated, or you cannot interact with other repo) |
Beta Was this translation helpful? Give feedback.
-
You can avoid a loop as described in this answer, by adding an
|
Beta Was this translation helpful? Give feedback.
-
What is My Account here? Can you please elaborate? |
Beta Was this translation helpful? Give feedback.
-
Which pieces of documentation did you look at, and which search terms did you use? We should be able to improve the SEO for the documentation so that this doesn't happen. |
Beta Was this translation helpful? Give feedback.
This is why we provide workflows with the GITHUB_TOKEN variable. It is explicitly configured to not run subsequent workflows to avoid this sort of behavior. If you had used GITHUB_TOKEN here, you should not have seen a loop.
Using a personal access token avoids this check, and will allow you to get into infinite loops if you’re not careful. So this is by-design but it looks like we should clarify this in the documentation - thanks for reporting this!