Behavior of `branches` filter on existing branches

Open Beginner friendly
#42,813 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions

Research direction

Start with the linked workflow syntax article and review the pull_request and push branches filter sections. Update the documentation to explain how existing matching branches behave when a workflow or filter is added, while preserving the surrounding guidance. Done means the reported behavior is clearly documented in both relevant sections.

Written by the indexing model from the issue text.

Description

content github_actions never-stale
Code of Conduct
What article on docs.github.com is affected?

https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax

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

These to parts that describe using a branches filter:

Additional information

I just lost about 5 hours trying a large variety of variations and reviewing the docs related to branches filters on GitHub Actions. Here is what I discovered, and I believe this important fact is nowhere in the docs and should be:

    When a workflow is put in place that has a `branches` filter, or modified
    to add additional branches to an existing `branches` filter, any matching
    branches that already existed PRIOR to this modification are NOT eligible
    to trigger the workflow.

    Only new branches added AFTER the workflow is in place, with matching
    branch names, can trigger the workflow.
Dominant language
TypeScript
Stars
20.9k
Forks
68.8k
Avg merge
15h 4m
Merged PRs (30d)
103

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/docs

All issues in github/docs

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.