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:
I made sure to use a PAT for the push, but it still does not trigger the other action.
Solved! Solved! Go to Solution.
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?
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.
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."
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.
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.
- name: Checkout current code
did the trick. Now a push with PAT works. Thanks!