File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Comment
2+
3+ on :
4+ workflow_run :
5+ workflows : ['Validate JSON']
6+ types :
7+ - completed
8+
9+ permissions :
10+ contents : read
11+ pull-requests : write
12+
13+ jobs :
14+ comment :
15+ runs-on : ubuntu-latest
16+ if : ${{ github.event.workflow_run.conclusion == 'failure' }}
17+ steps :
18+ - name : Download Artifact
19+ uses : actions/download-artifact@v4
20+ with :
21+ name : artifact
22+ github-token : ${{ secrets.GITHUB_TOKEN }}
23+ run-id : ${{ github.event.workflow_run.id }}
24+ - name : Comment on PR
25+ uses : actions/github-script@v7
26+ with :
27+ github-token : ${{ secrets.GITHUB_TOKEN }}
28+ script : |
29+ let fs = require('fs');
30+ const issue_number = Number(fs.readFileSync('./pr_number'));
31+ const artifactString = fs.readFileSync('./artifact.txt').toString().trimEnd();
32+ await github.rest.issues.createComment({
33+ owner: context.repo.owner,
34+ repo: context.repo.repo,
35+ issue_number: issue_number,
36+ body: `${artifactString}`
37+ });
You can’t perform that action at this time.
0 commit comments