Skip to content

Caching content: Caching the user stats and making submission sync to codeforces #47

Caching content: Caching the user stats and making submission sync to codeforces

Caching content: Caching the user stats and making submission sync to codeforces #47

name: Auto Comment on PR
on:
pull_request_target:
types: [opened]
permissions:
issues: write
pull-requests: write
jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: Comment on PR
uses: actions/github-script@v6
with:
script: |
try {
const prNumber = context.issue.number;
const prAuthor = context.payload.pull_request.user.login;
const commentBody = `### 🎉 Thanks for Your Contribution to **CanonForces**! ☺️
We'll review it as soon as possible. In the meantime, please:
- ✅ Double-check the **file changes**.
- ✅ Ensure that **all commits** are clean and meaningful.
- ✅ Link the PR to its related issue (e.g., \`Closes #123\`).
- ✅ Resolve any **unaddressed review comments** promptly.
💬 Need help or want faster feedback?
Join our Discord 👉 [CanonForces Discord](https://discord.gg/4YnYtVeF)
Thanks again for contributing 🙌 – @${prAuthor}!
cc: @aviralsaxena16`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: commentBody
});
console.log('✅ Auto comment on PR added successfully!');
} catch (error) {
console.error('❌ Error adding comment to PR:', error);
core.setFailed(`Failed to add comment: ${error.message}`);
}