Push from Action does not trigger subsequent action

I have an github action which sometimes pushes back to the repository, and I expect this push to trigger another action which configured with “on: push”, however this seems to not work. Is this intentional?

Sample repository to demonstate the issue: https://github.com/Stummi/workflow-playground/tree/master/.github/workflows

1 Like

Hi Stummi,

Glad to hear you in GitHub Community!

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.

Please create a personal access token in repo setting(write permission accordingly), replace GITHUB_TOKEN in your ‘inc-counter.yml’, code as below, thanks.

- name: Push changes
      uses: ad-m/github-push-action@master
      with:
        github_token: ${{ secrets.PAT}}

PAT1.png

1 Like

This helped. Thank you!

Is there a plan for removing this limitation? Providing a personal access token grants the Action far greater privileges than it needs.

1 Like

I’m using this same workflow with a second one triggered on pull_request. Even if I use a PAT my pull_request workflow doesn’t run when commits are pushed back to the PR branch. This is an example of my workflow https://gist.github.com/xt0rted/d0eac04e15a7cea80aa974a4448defef

3 Likes

The comments at https://github.community/t5/GitHub-Actions/Push-from-action-even-with-PAT-does-not-trigger-action/m-p/46293/highlight/true#M6505 solved my issue.

I needed to add persist-credentials: false to my checkout step since it’s using v2.

1 Like