forked from GoogleCloudPlatform/functions-framework-python
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from tpiperatgod/add_bots
add auto_assign and assign bot
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
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,23 @@ | ||
# Set to true to add reviewers to pull requests | ||
addReviewers: true | ||
|
||
# Set to author to set pr creator as assignee | ||
addAssignees: author | ||
|
||
# A list of reviewers to be added to pull requests (GitHub user name) | ||
reviewers: | ||
- benjaminhuo | ||
- kehuili | ||
- tpiperatgod | ||
|
||
# A list of keywords to be skipped the process that add reviewers if pull requests include it | ||
skipKeywords: | ||
- wip | ||
|
||
# A number of reviewers added to the pull request | ||
# Set 0 to add all the reviewers (default: 0) | ||
numberOfReviewers: 1 | ||
|
||
# A list of users to be skipped by both the add reviewers and add assignees processes | ||
skipUsers: | ||
- dependabot[bot] |
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,32 @@ | ||
name: Assign issue | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
assignbot: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Assign issue | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const payload = context.payload; | ||
const issue = context.issue; | ||
const isFromPulls = !!payload.issue.pull_request; | ||
const commentBody = payload.comment.body; | ||
if (!isFromPulls && commentBody && commentBody.indexOf("/assign") == 0) { | ||
if (!issue.assignees || issue.assignees.length === 0) { | ||
await github.rest.issues.addAssignees({ | ||
owner: issue.owner, | ||
repo: issue.repo, | ||
issue_number: issue.number, | ||
assignees: [context.actor], | ||
}) | ||
} | ||
return; | ||
} |