-
Notifications
You must be signed in to change notification settings - Fork 102
51 lines (45 loc) · 1.35 KB
/
32-pr-approved-and-labeled.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
name: 32 - PR approved and labeled
on:
pull_request:
types: [labeled]
pull_request_review:
types: [submitted]
jobs:
build:
runs-on: ubuntu-latest
if: ${{ (github.event.review.state == 'approved') && (contains(github.event.pull_request.labels.*.name, 'test')) }}
steps:
- run: echo "Do something"
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo "$GITHUB_CONTEXT"
- run: echo ${{ github.event.review.state }}
no-build:
runs-on: ubuntu-latest
if: ${{ (github.event.review.state != 'approved') || (!contains(github.event.pull_request.labels.*.name, 'test')) }}
steps:
- run: echo "Don't do it"
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo "$GITHUB_CONTEXT"
- run: ${{ github.event.review.state }}
test-1:
runs-on: ubuntu-latest
if: github.event.review.state == 'approved'
steps:
- run: echo "Approved!"
test-2:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'test')
steps:
- run: echo "Contains test label!"
test-3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: approved or not
if: github.event.review.state == 'approved'
run: |
echo "approved" ...