Skip to content

Mention that workflow needs to exist on default branch to use pull_request #39364

@vepadulano

Description

@vepadulano

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/reference/events-that-trigger-workflows

What part(s) of the article would you like to see updated?

https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request

Additional information

This is a followup to #31007. While developing my own github workflow in a similar fashion to the use case described at https://github.com/orgs/community/discussions/25746, I was using the pull_request trigger to avoid the issues of workflow_dispatch. The first time I opened the PR from my branch against the default branch, the workflow ran as part of the PR. On following changes+pushes to the branch, the workflow stopped running. After a few hours of debugging, I discovered that the workflow did not run for the same reason as the linked discussion, i.e. the workflow file must be present in the default branch before I can run on.pull_request from the feature branch. While I believe this is unacceptable behaviour for such a widely-spread CI system, I still think at the very least we deserve to have this documented. I believe the same wording

 This event will only trigger a workflow run if the workflow file exists on the default branch.

used in many other parts of the document should be used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentThis issue or pull request belongs to the Docs Content teamgithub_actionsPull requests that update GitHub Actions code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions