Skip to content

opened

opened #1605

# 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"