Skip to content

Commit

Permalink
chore: auto assign assignee (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
gitchannn authored Mar 4, 2024
1 parent 99b8401 commit c203311
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/assignee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Auto-assignee

on:
issues:
types: [opened]
pull_request:
types: [opened]

jobs:
assign:
runs-on: ubuntu-latest
steps:
- name: Assign to creator
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issue = context.payload.issue || context.payload.pull_request;
const creator = issue.user.login;
const issue_number = issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
console.log(`Assigning issue #${issue_number} to ${creator}`);
await github.issues.addAssignees({ owner, repo, issue_number, assignees: [creator] });

0 comments on commit c203311

Please sign in to comment.