Skip to content

Commit f7e1abb

Browse files
committed
Add PR Labeler workflow and config to cookiecutter
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 14d4940 commit f7e1abb

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
# TODO(cookiecutter): Add different parts of the source
10+
# For example:
11+
#
12+
# "part:module":
13+
# - "src/frequenz/{{cookiecutter.type}}/{{cookiecutter.name}}/module/**"
14+
#
15+
# "part:other":
16+
# - "src/frequenz/{{cookiecutter.type}}/{{cookiecutter.name}}/other/**"
17+
#
18+
# Please have in mind that that the part:xxx should be created as a issue label
19+
# in the GitHub repository"
20+
21+
"part:docs":
22+
- "**/*.md"
23+
- "docs/**"
24+
- "examples/**"
25+
- LICENSE
26+
27+
"part:tests":
28+
{%- if cookiecutter.type == "api" %}
29+
- "pytests/**"
30+
{%- else %}
31+
- "tests/**"
32+
{%- endif %}
33+
34+
"part:tooling":
35+
- "**/*.ini"
36+
- "**/*.toml"
37+
- "**/*.yaml"
38+
- "**/*.yml"
39+
- ".git*"
40+
- ".git*/**"
41+
- CODEOWNERS
42+
- MANIFEST.in
43+
- noxfile.py
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Pull Request Labeler
2+
3+
on: [pull_request_target]
4+
5+
jobs:
6+
Label:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Labeler
13+
# XXX: !!! SECURITY WARNING !!!
14+
# pull_request_target has write access to the repo, and can read secrets. We
15+
# need to audit any external actions executed in this workflow and make sure no
16+
# checked out code is run (not even installing dependencies, as installing
17+
# dependencies usually can execute pre/post-install scripts). We should also
18+
# only use hashes to pick the action to execute (instead of tags or branches).
19+
# For more details read:
20+
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
21+
uses: actions/labeler@0776a679364a9a16110aac8d0f40f5e11009e327 # 4.0.4
22+
with:
23+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)