Skip to content

Commit dc7b0a4

Browse files
niels9001Copilot
andauthored
Remove PR comment step from validation workflow (#39)
The Comment on PR step fails on fork PRs because GITHUB_TOKEN is read-only for pull_request events from forks (403 Resource not accessible by integration). Validation results are already written to GITHUB_STEP_SUMMARY and visible in the Actions UI. - Remove the Comment on PR step and its continue-on-error wrapper - Drop pull-requests: write permission (no longer needed) - Simplify validate step (remove id/continue-on-error since it is now the final step and should fail the job directly on errors) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent bf02ce4 commit dc7b0a4

1 file changed

Lines changed: 0 additions & 42 deletions

File tree

.github/workflows/validate-pr.yml

Lines changed: 0 additions & 42 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
validate:
@@ -28,8 +27,6 @@ jobs:
2827
run: pip install -r .github/scripts/requirements.txt
2928

3029
- name: Validate extension submission
31-
id: validate
32-
continue-on-error: true
3330
env:
3431
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3532
run: |
@@ -39,42 +36,3 @@ jobs:
3936
else
4037
echo "No extension files changed."
4138
fi
42-
43-
- name: Comment on PR
44-
if: always() && steps.validate.outcome != 'skipped'
45-
uses: actions/github-script@v7
46-
with:
47-
script: |
48-
const fs = require('fs');
49-
if (!fs.existsSync('validation-summary.md')) return;
50-
51-
const summary = fs.readFileSync('validation-summary.md', 'utf8');
52-
const marker = '<!-- cmdpal-extension-validation -->';
53-
const body = marker + '\n' + summary;
54-
55-
const { data: comments } = await github.rest.issues.listComments({
56-
owner: context.repo.owner,
57-
repo: context.repo.repo,
58-
issue_number: context.issue.number,
59-
});
60-
const existing = comments.find(c => c.body?.includes(marker));
61-
62-
if (existing) {
63-
await github.rest.issues.updateComment({
64-
owner: context.repo.owner,
65-
repo: context.repo.repo,
66-
comment_id: existing.id,
67-
body,
68-
});
69-
} else {
70-
await github.rest.issues.createComment({
71-
owner: context.repo.owner,
72-
repo: context.repo.repo,
73-
issue_number: context.issue.number,
74-
body,
75-
});
76-
}
77-
78-
- name: Fail if validation had errors
79-
if: steps.validate.outcome == 'failure'
80-
run: exit 1

0 commit comments

Comments
 (0)