Skip to content

Commit

Permalink
doc(): Create auto-assign-reviewer-and-assignee.yaml (#300)
Browse files Browse the repository at this point in the history
* Create auto-assign-reviewer-and-assignee.yaml

* Update auto-assign-reviewer-and-assignee.yaml

* Update auto-assign-reviewer-and-assignee.yaml
  • Loading branch information
narmidm authored Sep 22, 2023
1 parent a681b08 commit 81b17d9
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/auto-assign-reviewer-and-assignee.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Auto Assign Reviewer and Assignee
on:
pull_request:
types:
- opened

jobs:
auto_assign:
runs-on: ubuntu-latest

steps:
- name: Assign Reviewer and Assignee
uses: actions/github-script@v5
with:
script: |
const { data: pullRequest } = await github.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
// Assign the person who raised the PR as the assignee
const creatorUsername = pullRequest.user.login;
await github.pulls.createReviewRequest({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
reviewers: ["narmidm","bharath-avesha","YachikaRalhan","Rahul-D78","rahulsawra98","gourishkb","mridulgain"], // Replace "username" with the desired reviewer
assignees: [creatorUsername]
});
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 81b17d9

Please sign in to comment.