-
Notifications
You must be signed in to change notification settings - Fork 5.4k
59 lines (52 loc) · 2.05 KB
/
auto-review-trigger.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
52
53
54
55
56
57
58
59
on:
pull_request_target:
pull_request_review:
workflow_dispatch:
inputs:
pr_number:
description: Pull Request Number
type: string
required: true
issue_comment:
types:
- created
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
name: Auto Review Bot Trigger
jobs:
trigger:
runs-on: ubuntu-latest
name: Trigger
steps:
- name: Write PR Number - PR Target
run: echo $PR_NUMBER > pr-number.txt
if: github.event_name == 'pull_request_target' && ((!endsWith(github.event.sender.login, '-bot') && !endsWith(github.event.sender.login, '[bot]')) || github.event.sender.login == 'renovate[bot]')
env:
PR_NUMBER: ${{ github.event.number }}
- name: Write PR Number - PR Review
run: echo $PR_NUMBER > pr-number.txt
if: github.event_name == 'pull_request_review' && !endsWith(github.event.sender.login, '-bot') && !endsWith(github.event.sender.login, '[bot]')
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Write PR Number - Workflow Dispatch
run: echo $PR_NUMBER > pr-number.txt
if: github.event_name == 'workflow_dispatch'
env:
PR_NUMBER: ${{ inputs.pr_number }}
- name: Write PR Number - Comment Retrigger
run: echo $PR_NUMBER > pr-number.txt
if: github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@eth-bot rerun')
env:
PR_NUMBER: ${{ github.event.issue.number }}
- name: Check File Existence
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b
id: check_pr_number_exists
with:
files: pr-number.txt
- name: Save PR Number
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
if: steps.check_pr_number_exists.outputs.files_exists == 'true'
with:
name: pr-number
path: pr-number.txt