File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed
Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change 88
99permissions :
1010 contents : read
11- pull-requests : write
1211
1312jobs :
1413 schema-check :
1918 with :
2019 ref : ${{github.event.pull_request.head.ref}}
2120 repository : ${{github.event.pull_request.head.repo.full_name}}
21+ - name : Save PR number
22+ env :
23+ PR_NUMBER : ${{ github.event.number }}
24+ run : echo $PR_NUMBER > pr_number
2225 - name : Setup Node
2326 uses : actions/setup-node@v4
2427 with :
@@ -39,18 +42,17 @@ jobs:
3942 with :
4043 name : JSONValidationLog
4144 path : log.txt
42- - name : Comment Validation Issues
45+ - name : Create artifact for comment
4346 if : failure()
44- uses : actions/github-script@v7
47+ run : |
48+ echo "**The following issues were identified:**" > artifact.txt
49+ # Copy to generic name for commenting
50+ cat log.txt | tee -a artifact.txt
51+ - name : Upload list of issues
52+ if : failure()
53+ uses : actions/upload-artifact@v4
4554 with :
46- github-token : ${{secrets.GITHUB_TOKEN}}
47- script : |
48- const fs = require("fs");
49- const logPath = `${process.env.GITHUB_WORKSPACE}/log.txt`;
50- const logString = fs.readFileSync(logPath).toString().trimEnd();
51- github.issues.createComment({
52- issue_number: ${{ github.event.number }},
53- owner: context.repo.owner,
54- repo: context.repo.repo,
55- body: `**The following issues were identified:**\n\n<details><summary>Summary</summary>\n\n\`\`\`\n${logString}\n\`\`\`\n\n</details>`
56- })
55+ name : artifact
56+ path : |
57+ artifact.txt
58+ pr_number
You can’t perform that action at this time.
0 commit comments