Skip to content

Commit 459bc11

Browse files
authored
Update validate.yml
1 parent 2699926 commit 459bc11

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

.github/workflows/validate.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
permissions:
1010
contents: read
11-
pull-requests: write
1211

1312
jobs:
1413
schema-check:
@@ -19,6 +18,10 @@ jobs:
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

0 commit comments

Comments
 (0)