Skip to content

Commit

Permalink
321
Browse files Browse the repository at this point in the history
  • Loading branch information
mo3et committed Sep 18, 2024
1 parent 48511ea commit 1d08fb3
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/comment-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,27 @@ jobs:
- name: Comment on PR if errors found
if: failure() # This step runs only if the previous step fails
uses: peter-evans/[email protected]
uses: actions/github-script@v6
with:
token: ${{ secrets.GITHUB_TOKEN }} # GitHub token to post the comment
issue-number: ${{ github.event.pull_request.number }} # PR number
body: |
⚠️ Non-English comments were found in the following locations:
```
${{ steps.check-comments.outputs.non_english_comments }}
```
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const path = 'non_english_comments.txt';
const issueNumber = context.payload.pull_request.number;
if (fs.existsSync(path)) {
const comments = fs.readFileSync(path, 'utf8');
const body = `
⚠️ Non-English comments were found in the following locations:
\`\`\`
${comments}
\`\`\`
`;
await github.issues.createComment({
...context.repo,
issue_number: issueNumber,
body: body
});
}

0 comments on commit 1d08fb3

Please sign in to comment.