-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f984c7
commit 11a694f
Showing
2 changed files
with
69 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
name: Auto assignment for issues | ||
name: "Auto assignment for issues" | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
on: issue_comment | ||
|
||
env: | ||
GIHUB_TOKEN: ${{ secrets.BOT_ACCESS_TOKEN }} | ||
|
||
jobs: | ||
auto-assign: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
steps: | ||
- name: 'Auto-assign issue' | ||
uses: pozil/auto-assign-issue@v1 | ||
with: | ||
assignees: JamyGolden | ||
numOfAssignee: 1 | ||
allowSelfAssign: true | ||
auto-assign: | ||
name: auto assign | ||
runs-on: ubuntu-latest | ||
steps: | ||
- runs: echo "${{ env.BOT_ACCESS_TOKEN }}" | ||
# uses: ./.github/workflows/auto-assign-parent.yml | ||
# with: | ||
# token: ${{ env.BOT_ACCESS_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: "Auto assignment for issues" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
token: | ||
description: "GitHub Access Token" | ||
type: string | ||
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="${{ inputs.token }}" | ||
if [ -z "$token" ]; then | ||
echo "'token' not provided." | ||
exit 1 | ||
fi | ||
- uses: actions/checkout@v4 | ||
- 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@v2" | ||
with: | ||
repo-token: "${{ inputs.token }}" | ||
teams: "${{ steps.codeowners.outputs.value }}" | ||
numOfAssignee: 3 | ||
|