Skip to content

Commit dd5ca89

Browse files
ci: added workflow that labels PRs based on commits
This ensures that all commits follow the conventional commit standard.
1 parent a9241bc commit dd5ca89

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Label Pull Requests
2+
3+
on:
4+
pull_request_target:
5+
branches: [main, master, release, development]
6+
types: [opened, synchronize, reopened]
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
issues: write
12+
13+
jobs:
14+
15+
label-pull-requests:
16+
name: Label Pull Requests
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/[email protected]
21+
with: { fetch-depth: 0 }
22+
- name: Extract possible types/labels
23+
id: extract_types
24+
run: |
25+
types=$(yq -r '.[] | select(.type == true) | .name' .github/labels.yaml | paste -sd, -)
26+
echo "types=$types" >> "$GITHUB_OUTPUT"
27+
- name: Enforce Conventional Commits
28+
uses: webiny/[email protected]
29+
with:
30+
allowed-commit-types: ${{ steps.extract_types.outputs.types }}
31+
- name: Label Pull Request based on commits
32+
uses: FritjofH/[email protected]
33+
with:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
task_types: ${{ steps.extract_types.outputs.types }}
36+
custom_labels: "{}"
37+
link_on_failure: true
38+
add_scope_label: false
39+
add_label: true

0 commit comments

Comments
 (0)