-
Notifications
You must be signed in to change notification settings - Fork 62
42 lines (39 loc) · 1.18 KB
/
comment_on_pr.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
37
38
39
40
41
42
name: comment_on_pr
# read-write repo token
# access to secrets
on:
workflow_run:
workflows: ["simmetrx_enabled_pr_comment_trigger_self_hosted"]
types:
- completed
jobs:
upload:
permissions:
actions: read
issues: write
pull-requests: write
runs-on: ubuntu-latest
if: |
github.event.workflow_run.conclusion == 'success' ||
github.event.workflow_run.conclusion == 'failure'
steps:
- name: 'Download artifact'
uses: actions/download-artifact@v4
with:
name: pr
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}
- name: 'Comment on PR'
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs');
var issue_number = Number(fs.readFileSync('./issueNumber'));
var message = String(fs.readFileSync('./message'));
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: message
});