forked from zwave-js/node-zwave-js
-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (31 loc) · 987 Bytes
/
bot-approve.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: 'Z-Wave Bot: Approve PR'
on:
issue_comment:
types: [created] # edited, deleted
jobs:
# #########################################################################
# Approves a PR when authorized person comments
# @zwave-js-bot approve
approve-pr-manually:
if: |
contains(github.event.issue.html_url, '/pull/') &&
contains(github.event.comment.body, '@zwave-js-bot approve') &&
github.event.comment.user.login == 'AlCalzone'
runs-on: [ubuntu-latest]
strategy:
matrix:
node-version: [16.x] # This should be LTS
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.BOT_TOKEN}}
script: |
const options = {
owner: context.repo.owner,
repo: context.repo.repo,
};
await github.rest.pulls.createReview({
...options,
pull_number: context.payload.issue.number,
event: "APPROVE"
});