forked from kuznia-rdzeni/coreblocks
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 1.03 KB
/
publish_comment.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
name: Publish a PR comment
on:
workflow_run:
workflows: [Core Benchmarks]
types:
- completed
jobs:
benchmark-summary:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }}
permissions:
pull-requests: write
steps:
- uses: actions/download-artifact@v4
with:
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}
name: benchmark-summary
path: summary
- name: 'Comment on PR'
uses: actions/github-script@v6
with:
script: |
let fs = require('fs');
let issue_number = Number(fs.readFileSync('./summary/pr_number'));
let body = fs.readFileSync('./summary/comment.md', "utf-8");
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: body
});