Skip to content

Conversation

@wh0
Copy link

@wh0 wh0 commented Oct 12, 2025

Why:

In this line, there isn't really such thing as "the undefined Git ref." Rather "defined" and "undefined" describe the branches/tags filters when you define only one of them.

Closes:

What's being changed (if available, include any code snippets, screenshots, or gifs):

Check off the following:

  • A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
  • The changes in this PR meet the docs fundamentals that are required for all content.
  • All CI checks are passing and the changes look good in the review environment.

@welcome
Copy link

welcome bot commented Oct 12, 2025

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Oct 12, 2025
@github-actions
Copy link
Contributor

How to review these changes 👓

Thank you for your contribution. To review these changes, choose one of the following options:

A Hubber will need to deploy your changes internally to review.

Table of review links

Note: Please update the URL for your staging server or codespace.

The table shows the files in the content directory that were changed in this pull request. This helps you review your changes on a staging server. Changes to the data directory are not included in this table.

Source Review Production What Changed
actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow.md fpt
ghec
ghes@ 3.17 3.16 3.15 3.14
fpt
ghec
ghes@ 3.17 3.16 3.15 3.14
from reusable
actions/reference/workflows-and-actions/workflow-syntax.md fpt
ghec
ghes@ 3.17 3.16 3.15 3.14
fpt
ghec
ghes@ 3.17 3.16 3.15 3.14
from reusable

Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server

🤖 This comment is automatically generated.

@Sharra-writes
Copy link
Contributor

@wh0 Thanks for opening a PR! Copilot tells me this is correct, and I would be inclined to trust it since this is a small change, if it hadn't just completely made up a citation for me. So. I think I'm going to verify with an actual person.

@Sharra-writes Sharra-writes added content This issue or pull request belongs to the Docs Content team github_actions Pull requests that update GitHub Actions code and removed triage Do not begin working on this issue until triaged by the team labels Oct 13, 2025
Use the `tags` filter when you want to include tag name patterns or when you want to both include and exclude tag names patterns. Use the `tags-ignore` filter when you only want to exclude tag name patterns. You cannot use both the `tags` and `tags-ignore` filters for the same event in a workflow.

If you define only `tags`/`tags-ignore` or only `branches`/`branches-ignore`, the workflow won't run for events affecting the undefined Git ref. If you define neither `tags`/`tags-ignore` or `branches`/`branches-ignore`, the workflow will run for events affecting either branches or tags. If you define both `branches`/`branches-ignore` and [`paths`/`paths-ignore`](/actions/using-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore), the workflow will only run when both filters are satisfied.
If you define only `tags`/`tags-ignore` or only `branches`/`branches-ignore`, the workflow won't run for events affecting the undefined filter. If you define neither `tags`/`tags-ignore` or `branches`/`branches-ignore`, the workflow will run for events affecting either branches or tags. If you define both `branches`/`branches-ignore` and [`paths`/`paths-ignore`](/actions/using-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore), the workflow will only run when both filters are satisfied.
Copy link
Member

@larsxschneider larsxschneider Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe filter is not right... but Git ref is not right either.

Because if branches-ignore is set, then the workflow is indeed affecting the undefined Git refs AFAIK.

If you define only tags/tags-ignore or only branches/branches-ignore, the workflow won't run for events affecting the undefined filter.

Maybe we can remove that ☝️ sentence all together because we already discuss the filters in the previous paragraphs. I am not sure.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean if you set

on:
  push: 
    # tags not set
    # tags-ignore not set
    branches-ignore: nobuild

it will still run on all pushes to tags?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content This issue or pull request belongs to the Docs Content team github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants