Skip to content

Commit 3d0e4b3

Browse files
feat: Add dapr bot
Add dapr bot
2 parents fd31278 + 058e5d5 commit 3d0e4b3

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

.github/workflows/dapr-bot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: dapr-bot
2+
3+
on:
4+
issue_comment: {types: created}
5+
6+
7+
jobs:
8+
daprbot:
9+
name: bot-processor
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Comment analyzer
13+
uses: actions/github-script@v1
14+
with:
15+
github-token: ${{secrets.DAPR_BOT_TOKEN}}
16+
script: |
17+
const payload = context.payload;
18+
const issue = context.issue;
19+
const isFromPulls = !!payload.issue.pull_request;
20+
const commentBody = payload.comment.body;
21+
if (!isFromPulls && commentBody && commentBody.indexOf("/assign") == 0) {
22+
if (!issue.assignees || issue.assignees.length === 0) {
23+
await github.issues.addAssignees({
24+
owner: issue.owner,
25+
repo: issue.repo,
26+
issue_number: issue.number,
27+
assignees: [context.actor],
28+
})
29+
}
30+
return;
31+
}
52.2 KB
Loading

documentation/development.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,15 @@ npm run test:e2e:http:actors
5353

5454
## Publishing
5555

56-
Publishing is automated in the CI/CD pipeline. Each time a version is release (GitHub ref starting with `refs/tags/v`) then the pipeline will deploy the package as described in [build.yml](./.github/workflows/build.yml).
56+
Publishing is automated in the CI/CD pipeline. Each time a version is release (GitHub ref starting with `refs/tags/v`) then the pipeline will deploy the package as described in [build.yml](./.github/workflows/build.yml).
57+
58+
## Setup GitHub actions
59+
60+
1. Fork the [js-sdk](https://github.com/dapr/js-sdk) repo to your GitHub account.
61+
1. Go to `Settings` in the forked repo and click on `Secrets` -> `Action`:
62+
![GitHub Settings](./assets/github_setting.png)
63+
1. Add secret variables for Dapr CI
64+
65+
|Secret|Value|Usage|
66+
|--|--|--|
67+
|DAPR_BOT_TOKEN|[Your Github Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)|[dapr-bot.yml](https://github.com/dapr/js-sdk/blob/master/.github/workflows/dapr-bot.yml) uses it for administrative actions|

0 commit comments

Comments
 (0)