Skip to content

Commit a7a4f5b

Browse files
authored
Merge pull request #343 from Asymtode712/patch-4
Create autocomment-iss-raise.yml
2 parents 4bb3a06 + 2cc6d71 commit a7a4f5b

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Auto Comment on Issue
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
permissions:
8+
issues: write
9+
10+
jobs:
11+
comment:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
issues: write
15+
steps:
16+
- name: Add Comment to Issue
17+
run: |
18+
COMMENT=$(cat <<EOF
19+
{
20+
"body": "Thank you for creating this issue! 🎉 We'll look into it as soon as possible. In the meantime, please make sure to provide all the necessary details and context. If you have any questions or additional information, feel free to add them here. Your contributions are highly appreciated! 😊\n\nYou can also check our [CONTRIBUTING.md](https://github.com/recodehive/Stackoverflow-Analysis/blob/main/CONTRIBUTING.md) for guidelines on contributing to this project."
21+
}
22+
EOF
23+
)
24+
RESPONSE=$(curl -s -o response.json -w "%{http_code}" \
25+
-X POST \
26+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
27+
-H "Accept: application/vnd.github.v3+json" \
28+
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \
29+
-d "$COMMENT")
30+
cat response.json
31+
if [ "$RESPONSE" -ne 201 ]; then
32+
echo "Failed to add comment"
33+
exit 1
34+
fi
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)