-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (34 loc) 路 1.64 KB
/
Copy pathlabel-pr.yml
File metadata and controls
41 lines (34 loc) 路 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Label PR
on:
pull_request:
types:
- opened
- edited
branches:
- master
- feature/v3 #TODO: remove
concurrency:
group: label-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
label-pr:
if: github.event.action == 'opened' || github.event.changes.title
runs-on: ubuntu-latest
steps:
- name: Update PR labels
id: update-pr-labels
uses: ytanikin/pr-conventional-commits@1.5.2
with:
task_types: '["feat","fix","docs","ci"]'
continue-on-error: true
- name: Warn about invalid PR title
if: steps.update-pr-labels.outcome == 'failure'
run: gh pr comment "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --body "$BODY"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
BODY: |
馃憢 Hey @${{ github.event.pull_request.user.login }}, it looks like the PR title doesn't follow the [Conventional Commits](https://www.conventionalcommits.org) format.
While it's not a blocker for this PR, following the conventional commits format helps us to automatically calculate next release version, categorize changes and generate changelog.
Good candidates might be `feat: ${{ github.event.pull_request.title }}` or `fix: ${{ github.event.pull_request.title }}`. You can also add `!` to indicate a breaking change, e.g. `feat!: ${{ github.event.pull_request.title }}`.
Please follow the [Conventional Commits](https://www.conventionalcommits.org) for more details and examples. 馃檶