Skip to content

Commit d46007c

Browse files
committed
fix: correct labeler GitHub Actions workflow
1 parent ad40323 commit d46007c

File tree

2 files changed

+48
-18
lines changed

2 files changed

+48
-18
lines changed

.github/labeler.yml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
# This workflow will triage pull requests and apply a label based on the
2-
# paths that are modified in the pull request.
3-
#
4-
# To use this workflow, you will need to set up a .github/labeler.yml
5-
# file with configuration. For more information, see:
6-
# https://github.com/actions/labeler
1+
# Add 'root' label to any root file changes
2+
# Quotation marks are required for the leading asterisk
3+
root:
4+
- changed-files:
5+
- any-glob-to-any-file: '*'
76

8-
name: Labeler
9-
on: [pull_request_target]
7+
# Add 'AnyChange' label to any changes within the entire repository
8+
AnyChange:
9+
- changed-files:
10+
- any-glob-to-any-file: '**'
1011

11-
jobs:
12-
label:
12+
# Add 'Documentation' label to any change to .md files within the entire repository
13+
Documentation:
14+
- changed-files:
15+
- any-glob-to-any-file: '**/*.md'
1316

14-
runs-on: ubuntu-latest
15-
permissions:
16-
contents: read
17-
pull-requests: write
17+
# Add 'source' label to any change to src files within the source dir EXCEPT for the docs sub-folder
18+
source:
19+
- all:
20+
- changed-files:
21+
- any-glob-to-any-file: 'src/**/*'
22+
- all-globs-to-all-files: '!src/docs/*'
1823

19-
steps:
20-
- uses: actions/labeler@v4
21-
with:
22-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
24+
# Add 'feature' label to any PR where the head branch name starts with `feature` or has a `feature` section in the name
25+
feature:
26+
- head-branch: ['^feature', 'feature']
27+
28+
# Add 'release' label to any PR that is opened against the `main` branch
29+
release:
30+
- base-branch: 'main'

.github/workflows/label.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This workflow will triage pull requests and apply a label based on the
2+
# paths that are modified in the pull request.
3+
#
4+
# To use this workflow, you will need to set up a .github/labeler.yml
5+
# file with configuration. For more information, see:
6+
# https://github.com/actions/labeler
7+
8+
name: Labeler
9+
on: [pull_request_target]
10+
11+
jobs:
12+
label:
13+
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
pull-requests: write
18+
19+
steps:
20+
- uses: actions/labeler@v4
21+
with:
22+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)