Skip to content

Add pull_request synchronize trigger so workflows run when new commits are pushed to PR#5572

Open
emilykl wants to merge 3 commits intomainfrom
add-synchronize-trigger
Open

Add pull_request synchronize trigger so workflows run when new commits are pushed to PR#5572
emilykl wants to merge 3 commits intomainfrom
add-synchronize-trigger

Conversation

@emilykl
Copy link
Copy Markdown
Contributor

@emilykl emilykl commented Apr 13, 2026

Description of change

Add synchronize to the list of pull_request events which trigger the workflow to run.

Also add the list of pull_request triggers in build-doc.yml for consistency (this list is the same as the default so there's no actual change in behavior).

Also restricts the push event to apply only to the main branch; otherwise, pushing to a branch in the repo which also has an open PR causes the workflow to run twice.


The synchronize event occurs when new commits are added to the head branch of a PR.

Without this trigger, the workflows will run when a PR is first opened (or reopened), but will not run again when new commits are pushed.

I had assumed the push event would cover this case, but it seems that event only triggers for branches within the repository, not for forks. Thus we need to use pull_request synchronize.

N.b. the exact meaning of each event type is very poorly documented, but this comment confirms the meaning of synchronize.

@emilykl emilykl changed the title add pull_request synchronize trigger so workflows run when new commits are pushed to PR Add pull_request synchronize trigger so workflows run when new commits are pushed to PR Apr 13, 2026
@emilykl emilykl requested a review from camdecoster April 13, 2026 22:54
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

Successfully merging this pull request may close these issues.

1 participant