-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (36 loc) · 1.43 KB
/
add_reviewed_label.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
name: Add Review Label
on:
pull_request_review:
types:
- submitted
jobs:
check_reviews:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Count Approve
uses: luisrjaeger/approved-event-checker@1.0.0 # https://github.com/marketplace/actions/approved-event-checker
id: approved
with:
approvals: 2
check_changes_requested: true # change_requestがある場合はさ、approveにしない。
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check Approved
run: echo "Approval is ${{ steps.approved.outputs.approved }}"
- name: Check Reviewed label is exist
run: echo "Reviewed label is ${{ contains(github.event.pull_request.labels.*.name, 'Reviewed') }} "
- name: Check Executable
run: echo "${{ steps.approved.outputs.approved == 'true' && contains( github.event.pull_request.labels.*.name, 'Reviewed') == false}}"
- name: Add Reviewed Label
if: ${{ steps.approved.outputs.approved == 'true' && contains( github.event.pull_request.labels.*.name, 'Reviewed') == false}}
uses: actions/github-script@v4
with:
script: |
github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['Reviewed']
})