-
Notifications
You must be signed in to change notification settings - Fork 2
28 lines (26 loc) · 807 Bytes
/
assign.yml
File metadata and controls
28 lines (26 loc) · 807 Bytes
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
name: "Auto Assign"
run-name: "${{ github.workflow }} (${{ github.ref_name }}): ${{ github.event.pull_request.title }}"
on:
pull_request:
types:
- opened
- reopened
- ready_for_review
defaults:
run:
shell: bash
jobs:
assign:
runs-on: ubuntu-slim
timeout-minutes: 2
permissions:
pull-requests: write
steps:
- name: Assign PR to author if no assignees
if: ${{ github.event.pull_request.user.type != 'Bot' && toJSON(github.event.pull_request.assignees) == '[]' }}
run: gh pr edit $NUMBER --add-assignee $ASSIGNEE
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.pull_request.number }}
ASSIGNEE: ${{ github.event.pull_request.user.login }}