Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 7

Push from action (even with PAT) does not trigger action

Solved! Go to Solution.

I have 2 workflows that you can see here:
https://github.com/DataBiosphere/framework-env/tree/264a60fc614751b687e9d68e87bb225ba79f12d8/.github...

 

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.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.

6 Replies
Highlighted
Commander Lvl 1
Message 2 of 7

Re: Push from action (even with PAT) does not trigger action

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? 

Highlighted
Copilot Lvl 3
Message 3 of 7

Re: Push from action (even with PAT) does not trigger action

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.

Highlighted
Pilot Lvl 1
Message 4 of 7

Re: Push from action (even with PAT) does not trigger action

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."

Highlighted
Copilot Lvl 3
Message 5 of 7

Re: Push from action (even with PAT) does not trigger action

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.

Highlighted
Solution
GitHub Partner
Message 6 of 7

Re: Push from action (even with PAT) does not trigger action

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.

 

 

Highlighted
Copilot Lvl 3
Message 7 of 7

Re: Push from action (even with PAT) does not trigger action

Aha, yes!

- name: Checkout current code
uses: actions/checkout@v2
with:
persist-credentials: false

did the trick. Now a push with PAT works. Thanks!