-
Notifications
You must be signed in to change notification settings - Fork 18
63 lines (60 loc) · 2.02 KB
/
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
61
62
63
name: "Pull Request Labeler"
on:
pull_request_target:
types: ["opened"]
branches: ["master", "main"]
jobs:
labeler:
if: github.event.pull_request.user.login == 'devex-sa'
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Apply labels
id: label-the-PR
uses: actions/labeler@v5
with:
configuration-path: ".github/pr-labels.yml"
# Tried using a matrix for this but that floaded the PR checks
- name: Remove patch release
if: |
contains(steps.label-the-PR.outputs.all-labels, 'norelease') &&
contains(steps.label-the-PR.outputs.all-labels, 'release:patch')
uses: actions/github-script@v7
with:
script: |
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'release:patch'
})
- name: Remove minor release
if: |
contains(steps.label-the-PR.outputs.all-labels, 'norelease') &&
contains(steps.label-the-PR.outputs.all-labels, 'release:minor')
uses: actions/github-script@v7
with:
script: |
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'release:minor'
})
- name: Remove major release
if: |
contains(steps.label-the-PR.outputs.all-labels, 'norelease') &&
contains(steps.label-the-PR.outputs.all-labels, 'release:major')
uses: actions/github-script@v7
with:
script: |
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'release:major'
})