-
Notifications
You must be signed in to change notification settings - Fork 22
54 lines (47 loc) · 1.46 KB
/
shared-auto-assign-issues.yml
File metadata and controls
54 lines (47 loc) · 1.46 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
45
46
47
48
49
50
51
52
53
54
name: "Auto assignment for issues"
on:
workflow_call:
secrets:
token:
description: "GitHub Access Token"
required: true
jobs:
auto-assign:
runs-on: "ubuntu-latest"
permissions:
issues: "write"
outputs:
codeowners: ${{ steps.codeowners.outputs.value }}
steps:
- name: "Check token value"
run: |
token="${{ secrets.token }}"
if [ -z "$token" ]; then
echo "'secrets.token' not provided."
exit 1
fi
- uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08 # v4.1.7
- name: "Get teams from CODEOWNERS file"
id: "codeowners"
run: |
result=""
first_item=true
while IFS= read -r line; do
if [ "$first_item" = true ]; then
result="${line#* @tinted-theming/}"
first_item=false
else
result="$result, ${line#* @tinted-theming/}"
fi
done < .github/CODEOWNERS
if [ -z "$result" ]; then
echo "Error: unable to determine teams from .github/CODEOWNERS file"
exit 1
fi
echo "value=$result" >> $GITHUB_OUTPUT
- name: "Auto-assign issue"
uses: "pozil/auto-assign-issue@9fe872bb72487df4637d1eacd434c2fa97703230" # v2.0.0
with:
repo-token: "${{ secrets.token }}"
teams: "${{ steps.codeowners.outputs.value }}"
numOfAssignee: 3