Skip to content

Commit b9e416b

Browse files
autocomment-issue-raise.yml
1 parent 668d204 commit b9e416b

File tree

2 files changed

+43
-48
lines changed

2 files changed

+43
-48
lines changed

.github/workflows/autocomment-issue-raise.

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Auto Comment on Issue Open
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
permissions:
8+
issues: write
9+
10+
jobs:
11+
comment-on-issue:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Add Comment to Opened Issue
16+
run: |
17+
COMMENT=$(cat <<EOF
18+
{
19+
"body": "Thank you for creating this issue! 🎉 We'll look into it asap and assign you based on FCFS
20+
21+
- [ ] In the meantime, please make sure to Join recode org [Invite link](https://github.com/recodehive/Support/issues/new?assignees=&labels=invite+me+to+the+community&projects=&template=invitation.yml&title=Please+invite+me+to+the+Recode-Hive+GitHub+Community+Organization)
22+
- [ ] The main code file is located in gh-pages branch
23+
- [ ] Watch the complete youtube [GitHub Tutorial](https://stream.recodehive.com/github)
24+
25+
Your contributions are highly appreciated! 😊 Don't forgot to follow me @sanjay-kv
26+
`More surprise when you raise PR`"
27+
28+
}
29+
EOF
30+
)
31+
RESPONSE=$(curl -s -o response.json -w "%{http_code}" \
32+
-X POST \
33+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
34+
-H "Accept: application/vnd.github.v3+json" \
35+
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \
36+
-d "$COMMENT")
37+
cat response.json
38+
if [ "$RESPONSE" -ne 201 ]; then
39+
echo "Failed to add comment on issue open"
40+
exit 1
41+
fi
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)