Commit generated in one workflow does not trigger pull_request workflow #27146
-
Hello! I have to run a Github action everytime a specific file is changed in a PR, the action will edit a related file and make a new commit. This works great and was super easy using https://github.com/EndBug/add-and-commit. I do not know if the issue lies in the add-and-commit action or something else, but when the generated commit is pushed to the branch of the PR, the other workflows are not triggered all the time, and sometimes it works great. This is what my action looks like, and I would be very thankful for any hints on why it does not always trigger.
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
The problem is that you’re using GITHUB_TOKEN and not a PAT, as described in Using the
If you want the push to trigger new workflows you need to create a PAT with appropriate permissions, add it as a secret, and use that instead of GITHUB_TOKEN. |
Beta Was this translation helpful? Give feedback.
-
Hello! Now I have tried to do this by creating a Github App in the organization, using a github action to get an access_token from the app and using that for the commit. But it still does not trigger a new workflow. Which would be the appropriate permissions to trigger a new build? I based my Github App on https://dev.to/dtinth/authenticating-as-a-github-app-in-a-github-actions-workflow-27co |
Beta Was this translation helpful? Give feedback.
-
I usually just close and reopen the issue, that will trigger pull_request workflows and then smash the automerge button, so when the checks pass, it gets merged without any further input. Automerge is still in beta, you have to enable it in the repository settings. |
Beta Was this translation helpful? Give feedback.
-
Yes, that is what I currently do. But every time I reopen, dependabot will rebase and then it takes another round of for every time I merge something. Quite hard to work with 😕 |
Beta Was this translation helpful? Give feedback.
-
If you have more than a couple dependencies (including transitive) then you should probably use something that has grouped updates instead of dependabot. |
Beta Was this translation helpful? Give feedback.
-
I managed to get it to work with another token (used a Github App token but it should work with a Personal Access Token). The important part was setting the token when doing the initial checkout using
|
Beta Was this translation helpful? Give feedback.
I managed to get it to work with another token (used a Github App token but it should work with a Personal Access Token).
The important part was setting the token when doing the initial checkout using
actions/checkout@v2
, as described in GitHub - EndBug/add-and-commit: Add & commit files from a path directly from GitHub Actions.