Skip to content

Commit

Permalink
build: Auto assign (#46)
Browse files Browse the repository at this point in the history
* build: auto assign

* update: add permissions
  • Loading branch information
ronnnnn authored Oct 18, 2023
1 parent 5708d20 commit a128533
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/auto-asign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Auto assign ✌️

on:
pull_request:
types: [opened, synchronize]

jobs:
assign:
if: |
github.event.pull_request.user.type == 'User'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
timeout-minutes: 5
steps:
- uses: actions/github-script@v6
with:
script: |
const assignees = context.payload.pull_request.assignees
if (!assignees || assignees.length === 0) {
github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
assignees: `${{ github.actor }}`,
})
}

0 comments on commit a128533

Please sign in to comment.