-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
60 lines (51 loc) · 2.02 KB
/
pr-auto-labeler.yml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Automatic Pull Request Labeling
run-name: 'Set labels - PR #${{ github.event.pull_request.number }} ("${{ github.event.pull_request.title }}")'
#
# Set labels for pull requests automatically based on size (modified via job 'label-size') and file categories (modified via .github/labeler)
#
on: pull_request_target
jobs:
label-remove:
permissions:
contents: read # for pascalgn/size-label-action to determine modified files
pull-requests: write # for pascalgn/size-label-action to add labels to PRs
name: "Remove Ready to merge"
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize' }}
runs-on: ubuntu-latest
steps:
- uses: PauMAVA/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
add: ""
remove: "Ready to merge"
label-category:
permissions:
contents: read # for actions/labeler to determine modified files
pull-requests: write # for actions/labeler to add labels to PRs
name: "Category labels"
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
label-size:
permissions:
contents: read # for pascalgn/size-label-action to determine modified files
pull-requests: write # for pascalgn/size-label-action to add labels to PRs
name: "Size label"
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize' }}
runs-on: ubuntu-latest
steps:
- name: size-label
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
sizes: >
{
"0": "small",
"50": "medium",
"250": "large"
}