Skip to content

Commit b796818

Browse files
committed
ci: Add automatic pull request labeler
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent e9ca0e3 commit b796818

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/labeler.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Configuration for the Labeler GitHub action, executed by
2+
# .github/workflows/labeler.yml.
3+
#
4+
# The basic syntax is [label]: [path patterns].
5+
#
6+
# For more details on the configuration please see:
7+
# https://github.com/marketplace/actions/labeler
8+
9+
"part:docs":
10+
- "**/*.md"
11+
- LICENSE
12+
13+
"part:tests":
14+
- "tests/**"
15+
16+
"part:tooling":
17+
- ".git*"
18+
- ".git*/**"
19+
- "**/*.toml"
20+
- "**/*.ini"
21+
- CODEOWNERS
22+
- MANIFEST.in
23+
- "*requirements*.txt"
24+
- setup.py
25+
26+
"part:channels":
27+
- "src/frequenz/channels/**"

.github/workflows/labeler.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Pull Request Labeler
2+
3+
# XXX: !!! SECURITY WARNING !!!
4+
# pull_request_target has write access to the repo, and can read secrets. We
5+
# need to audit any external actions executed in this workflow and make sure no
6+
# checked out code is run (not even installing dependencies, as installing
7+
# dependencies usually can execute pre/post-install scripts). We should also
8+
# only use hashes to pick the action to execute (instead of tags or branches).
9+
# For more details read:
10+
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
11+
on: [pull_request_target]
12+
13+
jobs:
14+
Label:
15+
permissions:
16+
contents: read
17+
pull-requests: write
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Labeler
21+
# Only use hashes, see the security comment above
22+
uses: actions/labeler@e54e5b338fbd6e6cdb5d60f51c22335fc57c401e # 4.0.1
23+
with:
24+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)