-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (56 loc) · 1.99 KB
/
issue-triage.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
60
61
62
63
64
###
#
# This workflow file is deployed into this repository via the "Sync Organization Files" workflow
#
# Direct edits to this file are at risk of being overwritten by the next sync. All edits should be made
# to the source file.
#
# @see Sync workflow {@link https://github.com/gocodebox/.github/actions/workflows/workflow-sync.yml}
# @see Workflow template {@link https://github.com/gocodebox/.github/blob/trunk/.github/workflows/issue-triage.yml}
#
###
name: New Issue Triage and Assignment
on:
issues:
types: [ opened ]
jobs:
handle-new-issue:
runs-on: ubuntu-latest
env:
PRIMARY_CODEOWNER: '@thomasplevy'
steps:
- name: Checkout
uses: actions/checkout@v2
# Add to project.
#################
- name: Add to "Triage" project
uses: alex-page/github-project-automation-plus@v0.8.1
with:
project: Triage
column: Awaiting Triage
repo-token: ${{ secrets.ORG_WORKFLOWS }}
# Assign to the project's CODEOWNER.
####################################
- name: Check CODEOWNERS file existence
id: codeowners_file_exists
uses: andstor/file-existence-action@v1
with:
files: .github/CODEOWNERS
- name: Parse CODEOWNERS file
id: codeowner
if: steps.codeowners_file_exists.outputs.files_exists == 'true'
uses: SvanBoxel/codeowners-action@v1
with:
path: .github/CODEOWNERS
- name: Update PRIMARY_CODEOWNER env var
if: steps.codeowners_file_exists.outputs.files_exists == 'true'
run: |
echo PRIMARY_CODEOWNER=$( echo '${{ steps.codeowner.outputs.codeowners }}' | jq -r '."*"[0]' ) >> $GITHUB_ENV
- name: Strip @ from username
run: |
echo "PRIMARY_CODEOWNER=${PRIMARY_CODEOWNER#?}" >> $GITHUB_ENV
- name: Assign issue
uses: pozil/auto-assign-issue@v1
with:
repo-token: ${{ secrets.ORG_WORKFLOWS }}
assignees: ${{ env.PRIMARY_CODEOWNER }}