-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Action does not get triggered for last commit when base branch is changed #980
Comments
Please let me know if this is the right repository for this issue. |
Hey @R1j1t , The pull request event has a variety of triggers, by default we subscribe to opened, synchronize, or reopened. You can read more about those here: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request Changing the base ref is the
However, You may filter these down using expressions, the github context stores information about why the edited event was triggered, for example:
For more information on how to filter jobs based on the value of the context, please see our official docs I've brought feedback to the team that we should consider an event for only base ref changes as an enhancement and add it by default, but it's not currently available and I don't have a timeline for when it may be available. I'm going to close this issue for now, but feel free to reopen it if you have any more questions! |
Thanks @thboop for the detailed explanation. It definitely answers all the question I had. I will check the documentation to learn more about it. I really appreciate the quick response! |
@thboop help me with this issue. For some reason Im editing the Title of the PR and it does not start the action. Sometimes it does, but I can't understand why it does it sometimes. https://github.community/t/action-not-starting-when-editing-the-title-or-description-of-a-pr/216836 |
Hi @thboop, the doc you linked (https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request) refers to https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request for more information on activity types. In that doc about webhook events, the
Is that fragment of documentation out-of-date? |
@thboop has there been any more talks internally about adding this as a default? It's quite surprising that workflow doesn't get triggered when the base branch is changed with e.g. the following configuration: on:
pull_request:
branches:
- master |
I accidentally selected master as base branch when creating the PR. When changing this to develop, the checks where not triggered. To fix this I added the `edited` type, which is used when changing the base ref. See actions/runner#980
I accidentally selected master as base branch when creating the PR. When changing this to develop, the checks where not triggered. To fix this I added the `edited` type, which is used when changing the base ref. See actions/runner#980
@michalinacienciala I assume that "base branch is changed" means not that new commits are pushed to master, but |
@cakeinpanic in my case it happens if you base a PR on another PR and the first PR gets merged. Github changes the base of the second to With a similar configuration like @LinusU on:
push:
branches:
- main
pull_request:
branches:
- main |
what happens if a base branch is rebased along with new commits? what would be event that would be triggered here? Apologies for asking question on a closed thread. |
If your workflow is sub to pull_request.edited, then it should be triggered when changing base:HEAD because the base name is just an alias for the commit sha, and the commit sha has changed. "event": { "action": "edited", "changes": { "base": { "ref": { "from": "main" }, "sha": { "from": "{some sha here}" } } }, the event would have a different |
So to confirm, in the below workflow |
You changed your question. You would need a different event. It depends on if you want to trigger on push or pr, when changing your source branch. |
As documented in actions/runner#980 (comment) This occurs when a PR is marked as depending on another PR, has that other PR's branch as its base branch, and GitHub then automatically changes the base branch after the first PR is merged.
Describe the bug
When the base branch of the PR is changed, action does not get triggered for the last commit in that PR.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
what I was expecting was actions to be triggered for the last commit in the PR. Wanted to check if it is not the expected behavior.
Runner Version and Platform
Version of your runner? Public Github
OS of the machine running the runner? OSX/Windows/Linux/...
NA
What's not working?
Github action not getting triggered.
Job Log Output
R1j1t/contextualSpellCheck#49 (comment) link to base branch change in PR.
Runner and Worker's Diagnostic Logs
NA
The text was updated successfully, but these errors were encountered: