Skip to content

Commit e92056a

Browse files
committed
chore: add labeler action workflow
1 parent fa57ec7 commit e92056a

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.github/labeler.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# https://github.com/actions/labeler?tab=readme-ov-file#usage
2+
3+
# Add the `4.8` label to PRs that target the `4.8` branch.
4+
'4.8': # @todo change value whenever the next minor version is changed
5+
- base-branch: '4.8'
6+
7+
# Add the `github_actions` label to PRs that change any file in the `.github/workflows/` directory.
8+
'github_actions':
9+
- changed-files:
10+
- any-glob-to-any-file:
11+
- '.github/workflows/*'
12+
13+
# Add the `documentation` label to PRs that change any file in the `user_guide_src/source/` directory.
14+
'documentation':
15+
- changed-files:
16+
- any-glob-to-all-files:
17+
- 'user_guide_src/source/*'
18+
19+
# Add the `testing` label to PRs that change files in the `tests/` directory ONLY.
20+
'testing':
21+
- changed-files:
22+
- any-glob-to-all-files:
23+
- 'tests/*'

.github/workflows/label-pr.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Add Labels to PRs
2+
3+
# NOTE: When updating this workflow, you should first change the event to `pull_request` to test the changes
4+
# in a PR, and then change it back to `pull_request_target` before merging.
5+
# @see https://github.com/actions/labeler?tab=readme-ov-file#updating-major-version-of-the-labeler
6+
on:
7+
# to change to pull_request_target before merge; needs pull_request to test in PR
8+
- pull_request
9+
10+
jobs:
11+
add-labels:
12+
permissions:
13+
contents: read
14+
pull-requests: write
15+
runs-on: ubuntu-24.04
16+
17+
steps:
18+
- name: Add labels
19+
uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
20+
with:
21+
sync-labels: true # Remove labels when matching files are reverted

0 commit comments

Comments
 (0)