-
Notifications
You must be signed in to change notification settings - Fork 33
45 lines (40 loc) · 1.2 KB
/
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
36
37
38
39
40
41
42
43
44
45
---
name: "comment"
on:
workflow_run:
workflows:
- rstcheck
types:
- completed
jobs:
comment:
name: Comment
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'pull_request' }}
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: results
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
path: results
- name: Update pr with info from other runners
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs');
var issue_number = Number(fs.readFileSync('./results/id'));
var problem_count = Number(fs.readFileSync(
'./results/problem-count'
));
var summary = String(fs.readFileSync('./results/summary'));
if (problem_count > 0) {
github.rest.issues.createComment({
owner: context.repo.owner,
issue_number: issue_number,
repo: context.repo.repo,
body: summary
});
}