Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push not triggering workflow #32

Closed
FelipeRRM opened this issue Nov 13, 2019 · 13 comments
Closed

Push not triggering workflow #32

FelipeRRM opened this issue Nov 13, 2019 · 13 comments

Comments

@FelipeRRM
Copy link

I have two branches in my repo, "master" and "branch2". I also have two separate workflows, one for each branch, and each of them is triggered by a push on that specific branch. The thing is that I am using this action here inside master's workflow to push some changes to "branch2". The push is working very well, but the problem is that it is not triggering the workflow on "branch2" as it should, while pushing manually from github does. What might be the issue?

@ad-m
Copy link
Owner

ad-m commented Nov 13, 2019

Yes, push using standard GitHub Token not trigger workflow. It is GitHub design to avoid infinity triggers loop.

@ad-m
Copy link
Owner

ad-m commented Nov 13, 2019

Push and any other actions by GitHub Action eg.comments not trigger GitHub Action.

@FelipeRRM
Copy link
Author

Oh I see, any tips on how to circumvent this limitation then? I see that they don't want infinite triggers but it is also very limiting at the same time.

@ad-m
Copy link
Owner

ad-m commented Nov 13, 2019

I don't tested, but let's try Personal Access Token in GitHub Action.

@FelipeRRM
Copy link
Author

@ad-m it worked! When using a personal token to push instead of the default GitHub Token available in the action it triggers the other workflow! Amazing!

@rokroskar
Copy link

Does this still work? I have a workflow where I push with a private access token and it doesn't seem to trigger a new CI build. Maybe github changed the behavior?

@Kubitomakita
Copy link

For some reason pushing with personal token works in one of my repositories, but not the other. Config seems to be the same

@rokroskar
Copy link

@Kubitomakita if you are using the checkout action, try giving it your PAT as well.

@Kubitomakita
Copy link

Kubitomakita commented Mar 3, 2020

Thanks for the hint @rokroskar !

Turned out it works as expected with actions/checkout@v1 but not with actions/checkout@v2. This applies to the action which is commiting the change.

@rokroskar
Copy link

So giving the PAT to actions/checkout@v2 fixes the problem? Or are you saying that it is still persisting?

@Kubitomakita
Copy link

Kubitomakita commented Mar 3, 2020

Haven't tested giving PAT to actions/checkout@v2 but downgrading to actions/checkout@v1 works without PAT passed to this step

@rokroskar
Copy link

Ah ok - because I think in v2 they changed how the credentials are stored, and I think it overrides the PAT passed to the push action.

@paulhenri-l
Copy link

I can confirm that using the PAT in the actions/checkout@v2 action fixes the issue 👍🏻

adborden added a commit to adborden/zoom-overlay that referenced this issue Jun 4, 2020
Use personal access token in checkout action as well as the push.

ad-m/github-push-action#32
myml added a commit to linuxdeepin/.github that referenced this issue Apr 18, 2022
GitHub Action Token not trigger other workflows
It is GitHub design to avoid infinity triggers loop.
See: ad-m/github-push-action#32

Log:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants