Triggering a workflow when PR "combined status" is updated #25547
-
I’m trying to trigger a workflow when the “combined status” of a pull request is updated. I would like to use this for a workflow that notifies the PR author of failing tests in a PR, or to compose a workflow that auto-merges a PR when all requirements are met (all tests pass, labels/milestone set, etc.). I tried achieves this using the check_run, check_suite and status events, but none of those seem to be triggering anything… Other events in the same workflow (e.g. issue_comment) are working as expected. A previous post was asking a similar question (https://github.community/t5/GitHub-Actions/How-to-trigger-workflow-when-all-checks-pass-for-pull-request/m-p/33944#M1726), but the answer didn’t help me at all… Am I overlooking something obvious? Test workflow:
(see also https://github.com/boegel/test-github-actions/blob/master/.github/workflows/test.yml) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @boegel, Thank you for being here and our apologies for the delayed response. I believe you are running into a known limitation: > 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. |
Beta Was this translation helpful? Give feedback.
-
Hey @andreagriffiths11 , Thank you for your response. I’m also running into this, is there a planned fix for this? Or do we, assuming I read your quote right, have to use a token from https://github.com/settings/tokens and let the action pose as us. Will it trigger then next action then? |
Beta Was this translation helpful? Give feedback.
-
Ok so I can confirm that this works. Have something set up at https://github.com/WyriHaximus/php-fake-php-version/tree/master/.github/workflows that will create a PR (with milestone and labels), auto merge it when all checks are green, close the milestone, and create a release. Each step is a workflow and triggers another workflow. They didn’t trigger with the default GITHUB_TOKEN, but they do when you create a custom token. |
Beta Was this translation helpful? Give feedback.
Ok so I can confirm that this works. Have something set up at https://github.com/WyriHaximus/php-fake-php-version/tree/master/.github/workflows that will create a PR (with milestone and labels), auto merge it when all checks are green, close the milestone, and create a release. Each step is a workflow and triggers another workflow. They didn’t trigger with the default GITHUB_…