mirror of https://github.com/dapr/cli.git
Allows anybody to /assign via Dapr Bot (#778)
This commit is contained in:
parent
d6a8ea4082
commit
6d932a7bd9
|
@ -0,0 +1,32 @@
|
||||||
|
name: dapr-bot
|
||||||
|
|
||||||
|
on:
|
||||||
|
issue_comment: {types: created}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
daprbot:
|
||||||
|
name: bot-processor
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Comment analyzer
|
||||||
|
uses: actions/github-script@v1
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.DAPR_BOT_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.issues.addAssignees({
|
||||||
|
owner: issue.owner,
|
||||||
|
repo: issue.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
assignees: [context.actor],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
Loading…
Reference in New Issue