-
Notifications
You must be signed in to change notification settings - Fork 625
62 lines (59 loc) · 2.21 KB
/
bot-label-lgtm.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
# This workflow adds the community approval label ("lgtm") to pull requests. It
# does *not* indicate maintainer approval. This a way to visually highlight that
# someone in the world thinks the pull request is ready for further review. This
# event is triggered by a pull request approval, or simply a comment that
# contains the text "lgtm".
# Webhook events: Pull request, Issue comments, Pull request reviews
name: Community approval
on:
repository_dispatch:
# From: pull_request, issue_comment, pull_request_review
types: [opened, created, edited, submitted]
jobs:
lgtm-comment:
# Check the comment. contains() is case-insensitive.
if: >-
${{ github.actor == 'tfdocsbot' &&
contains(github.event.client_payload.comment.body, 'LGTM') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Add label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_URL: ${{ github.event.client_payload.comment.issue_url }}
run: |
source ./tools/ci/utils.sh
add_label "lgtm"
review-approval:
# Check the pull request review.
if: >-
${{ github.actor == 'tfdocsbot' &&
contains(github.event.client_payload.review.state, 'approved') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Add label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_URL: ${{ github.event.client_payload.pull_request.issue_url }}
run: |
source ./tools/ci/utils.sh
add_label "lgtm"
review-vendor:
# New pull requests already reviewed by vendors in GitLocalize.
if: >-
${{ github.actor == 'tfdocsbot' &&
github.event.client_payload.action == 'opened' &&
github.event.client_payload.pull_request.user.login == 'gitlocalize-app[bot]' &&
contains(github.event.client_payload.pull_request.body, 'Translated by Alconost') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Add label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_URL: ${{ github.event.client_payload.pull_request.issue_url }}
run: |
source ./tools/ci/utils.sh
add_label "lgtm-vendor"