mirror of
https://github.com/actions/labeler.git
synced 2025-12-11 12:07:32 +00:00
Update README with reference to branch options
This commit is contained in:
14
README.md
14
README.md
@@ -9,7 +9,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
Automatically label new pull requests based on the paths of files being changed.
|
Automatically label new pull requests based on the paths of files being changed or the branch name.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -26,13 +26,15 @@ For more control over matching, you can provide a match object instead of a simp
|
|||||||
```yml
|
```yml
|
||||||
- any: ['list', 'of', 'globs']
|
- any: ['list', 'of', 'globs']
|
||||||
all: ['list', 'of', 'globs']
|
all: ['list', 'of', 'globs']
|
||||||
|
branch: ['list', 'of, 'globs']
|
||||||
```
|
```
|
||||||
|
|
||||||
One or both fields can be provided for fine-grained matching. Unlike the top-level list, the list of path globs provided to `any` and `all` must ALL match against a path for the label to be applied.
|
One or all fields can be provided for fine-grained matching. Unlike the top-level list, the list of path globs provided to `any` and `all` must ALL match against a path for the label to be applied.
|
||||||
|
|
||||||
The fields are defined as follows:
|
The fields are defined as follows:
|
||||||
* `any`: match ALL globs against ANY changed path
|
* `any`: match ALL globs against ANY changed path
|
||||||
* `all`: match ALL globs against ALL changed paths
|
* `all`: match ALL globs against ALL changed paths
|
||||||
|
* `branch`: match ANY glob against the branch name
|
||||||
|
|
||||||
A simple path glob is the equivalent to `any: ['glob']`. More specifically, the following two configurations are equivalent:
|
A simple path glob is the equivalent to `any: ['glob']`. More specifically, the following two configurations are equivalent:
|
||||||
```yml
|
```yml
|
||||||
@@ -56,6 +58,10 @@ label1:
|
|||||||
|
|
||||||
# Add 'label2' to any file changes within 'example2' folder
|
# Add 'label2' to any file changes within 'example2' folder
|
||||||
label2: example2/*
|
label2: example2/*
|
||||||
|
|
||||||
|
# Add 'label3' to any PR where the branch name starts with 'example3'
|
||||||
|
label3:
|
||||||
|
- branch: 'example3/**'
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Common Examples
|
#### Common Examples
|
||||||
@@ -82,6 +88,10 @@ source:
|
|||||||
frontend:
|
frontend:
|
||||||
- any: ['src/**/*.js']
|
- any: ['src/**/*.js']
|
||||||
all: ['!src/main.js']
|
all: ['!src/main.js']
|
||||||
|
|
||||||
|
# Add 'feature' label to any branch that starts with `feature` or has a `feature` section in the name
|
||||||
|
feature:
|
||||||
|
- branch: ['feature/**', '*/feaure/**']
|
||||||
```
|
```
|
||||||
|
|
||||||
### Create Workflow
|
### Create Workflow
|
||||||
|
|||||||
Reference in New Issue
Block a user