Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
JamyGolden committed Aug 21, 2024
1 parent 5f984c7 commit 2215b0f
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 15 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/auto-assign-issues.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
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:
- name: first step
run: echo "${{ env.BOT_ACCESS_TOKEN }}"
# uses: ./.github/workflows/auto-assign-parent.yml
# with:
# token: ${{ env.BOT_ACCESS_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/auto-assign-parent.yml
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

0 comments on commit 2215b0f

Please sign in to comment.