Behavior of `branches` filter on existing branches
- 主要語言
- TypeScript
- 星號
- 20.8k
- 分支
- 68.7k
- 平均合併
- 13 小時 10 分鐘
- 30 天內合併 PR
- 111
描述
### Code of Conduct
- [x] I have read and agree to the GitHub Docs project's [Code of Conduct](https://github.com/github/docs/blob/main/.github/CODE_OF_CONDUCT.md)
### 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:
- [on..](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onpull_requestpull_request_targetbranchesbranches-ignore)
- [on.push.](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onpushbranchestagsbranches-ignoretags-ignore)
### 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.
```
貢獻指南
研究方向
從連結的工作流程語法文章開始,查看 pull_request 和 push 分支篩選器部分。更新文件,說明新增工作流程或篩選器時現有相符分支的行為,同時保留周圍的指引內容。當所述行為已在兩個相關部分中清楚記錄時,即視為完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- github-actions
- 領域
- ci-cd, documentation
- Issue 類型
- 文件
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 活躍
- 描述清晰度
- 描述清楚
- 新手友好度
- 78/100