-
-
Notifications
You must be signed in to change notification settings - Fork 76
37 lines (31 loc) · 1.35 KB
/
issues.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
name: Add Comment to Newly Open Issue
on:
issues:
types:
- opened
jobs:
add-comment:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Add Comment
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: >
const { issue } = context.payload;
const author = issue.user.login;
const issueNumber = issue.number;
const comment = `Hello @${author}! \n Thank you for raising this issue. \nPlease make sure to follow our [Contributing Guidelines.](https://github.com/devs-in-tech/DevsInTech/blob/main/CONTRIBUTING.md) \nDon't forget to ⭐ our [DevsInTech](https://github.com/devs-in-tech/DevsInTech)\n\nOur review team will carefully assess the issue and reach out to you soon!\n We appreciate your patience!`;
const { owner, repo } = context.repo;
await github.issues.createComment({
owner: owner,
repo: repo,
issue_number: issueNumber,
body: comment
});
console.log(`Comment added to the Issue #${issueNumber}.`);