forked from thunderbird/thunderbird-android
-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (27 loc) · 1.01 KB
/
Copy pathpulls-auto-assign.yml
File metadata and controls
30 lines (27 loc) · 1.01 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
---
name: Auto Assign Reviewer
# Warning, this job is running on pull_request_target and therefore has access to issue content.
# Don't add any steps that act on external code.
on:
pull_request_target:
types: [review_requested]
jobs:
assign-reviewer:
runs-on: ubuntu-latest
environment: botmobile
steps:
- name: App token generate
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
if: ${{ vars.BOT_CLIENT_ID }}
id: app-token
with:
app-id: ${{ vars.BOT_CLIENT_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Assign reviewer to PR
if: ${{ github.event.requested_reviewer }}
env:
PR_REVIEWER: ${{ github.event.requested_reviewer.login }}
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
run: |
gh pr edit $PR_NUMBER --repo $GITHUB_REPOSITORY --add-assignee "$PR_REVIEWER"