-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow_call support to action and add action for repo reuse
- Loading branch information
1 parent
838fe21
commit 4b709fa
Showing
3 changed files
with
58 additions
and
35 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 @@ | ||
* @tinted-theming/admins |
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
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,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@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: "${{ secrets.token }}" | ||
teams: "${{ steps.codeowners.outputs.value }}" | ||
numOfAssignee: 3 |