forked from carbon-language/carbon-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (93 loc) · 3.22 KB
/
proposal_labeled.yaml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Applies mutual exclusivity between states labels:
# - proposal draft
# - proposal rfc
# - proposal accepted
# - proposal declined
# - proposal deferred
#
# The "proposal" label is always applied in order to make searching for all
# proposals (regardless of state) easy, although it will typically already be
# present.
name: Proposal labeled
on:
pull_request_target:
types:
- labeled
permissions:
pull-requests: write # For gh to edit labels.
jobs:
proposal_labeled:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: draft
if: |
github.event.label.name == 'proposal draft'
run: |
gh pr edit "${PR}" \
--remove-label "proposal rfc" \
--remove-label "proposal accepted" \
--remove-label "proposal declined" \
--remove-label "proposal deferred" \
--add-label "proposal"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.html_url }}
- name: rfc
if: |
github.event.label.name == 'proposal rfc'
run: |
gh pr edit "${PR}" \
--remove-label "proposal draft" \
--remove-label "proposal accepted" \
--remove-label "proposal declined" \
--remove-label "proposal deferred" \
--add-label "proposal"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.html_url }}
- name: accepted
if: |
github.event.label.name == 'proposal accepted'
run: |
gh pr edit "${PR}" \
--remove-label "proposal draft" \
--remove-label "proposal rfc" \
--remove-label "proposal declined" \
--remove-label "proposal deferred" \
--add-label "proposal"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.html_url }}
- name: declined
if: |
github.event.label.name == 'proposal declined'
run: |
gh pr edit "${PR}" \
--remove-label "proposal draft" \
--remove-label "proposal rfc" \
--remove-label "proposal accepted" \
--remove-label "proposal deferred" \
--add-label "proposal"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.html_url }}
- name: deferred
if: |
github.event.label.name == 'proposal deferred'
run: |
gh pr edit "${PR}" \
--remove-label "proposal draft" \
--remove-label "proposal rfc" \
--remove-label "proposal accepted" \
--remove-label "proposal declined" \
--add-label "proposal"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.html_url }}