-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (43 loc) · 1.3 KB
/
approve-pr.yml
File metadata and controls
44 lines (43 loc) · 1.3 KB
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
# Approve Pull Request
#
# Automatically approve a pull request when a review is requested from @flexdevelopment by certain
# users.
#
#
# References:
#
# - https://cli.github.com/manual/gh_pr_review
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#pull_request
# - https://github.com/actions/checkout
# - https://github.com/dependabot/fetch-metadata
---
name: approve-pr
on:
pull_request:
types:
- review_requested
env:
GITHUB_TOKEN: ${{ secrets.PAT_BOT }}
jobs:
approve-pr:
if: github.event.requested_reviewer.login == 'flexdevelopment'
runs-on: ubuntu-latest
steps:
- id: dependabot-metadata
name: Fetch dependabot metadata
if: github.actor == 'dependabot[bot]'
uses: dependabot/fetch-metadata@v1.3.3
with:
skip-commit-verification: true
- id: checkout
name: Checkout ${{ github.head_ref }}
uses: actions/checkout@v3.0.2
with:
persist-credentials: false
ref: ${{ github.head_ref }}
- id: approve
name: Approve pull request
if: |
github.actor == 'unicornware' ||
steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major'
run: gh pr review ${{ github.event.number }} --approve --body 'lgtm 👍🏾'