chore: proper escaping, see #24300, drop actions/ai-inference and use plain js

This commit is contained in:
Michael Geers 2025-10-14 10:09:35 +02:00
parent 3f3c8251b9
commit da58fb3d88

View file

@ -91,13 +91,27 @@ jobs:
if (analysis.requires_reminder) {
const comment = context.payload.comment;
await github.rest.pulls.createReviewComment({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
body: `@${comment.user.login} 🇬🇧 Please use English so everyone can participate. See [Contributing Guidelines](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/master/CONTRIBUTING.md#communication-language).`,
commit_id: comment.commit_id,
path: comment.path,
in_reply_to: comment.id
});
const reminderMessage = `@${comment.user.login} 🇬🇧 Please use English so everyone can participate. See [Contributing Guidelines](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/master/CONTRIBUTING.md#communication-language).`;
// Handle different event types
if (context.eventName === 'pull_request_review_comment') {
// Review comment on PR - reply in thread
await github.rest.pulls.createReviewComment({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
body: reminderMessage,
commit_id: comment.commit_id,
path: comment.path,
in_reply_to: comment.id
});
} else if (context.eventName === 'issue_comment' && context.payload.issue.pull_request) {
// Comment on PR issue - post as issue comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
body: reminderMessage
});
}
}