Skip to content

Commit 5368f31

Browse files
committed
Add auto-comment.yml
1 parent 3a45898 commit 5368f31

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/auto-comment.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Auto Comment on PRs and Issues
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request:
7+
types: [opened]
8+
9+
jobs:
10+
auto-comment:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Comment on Issue or PR
14+
uses: actions/github-script@v6
15+
with:
16+
script: |
17+
const message = `
18+
Hi @${context.payload.sender.login} 👋
19+
20+
Thank you for ${context.eventName === 'issues' ? 'opening this issue!' : 'submitting this pull request!'} 🚀
21+
22+
${context.eventName === 'issues'
23+
? 'I’ve noted it and will review it soon. Please include steps to reproduce, screenshots, or additional context if applicable.'
24+
: 'Your PR has been received and I’ll review it as soon as possible. Ensure your code follows the contribution guidelines and that tests are updated if necessary.'}
25+
26+
I really appreciate your effort to improve this project! 🙌
27+
`;
28+
github.rest.issues.createComment({
29+
issue_number: context.payload[context.eventName === 'issues' ? 'issue' : 'pull_request'].number,
30+
owner: context.repo.owner,
31+
repo: context.repo.repo,
32+
body: message,
33+
});

0 commit comments

Comments
 (0)