Skip to content

Commit 854b631

Browse files
Merge pull request #952 from HimangshuSharma01/main
autocomment-issue-raise.yml added
2 parents 8acc4c7 + 3396931 commit 854b631

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,37 @@
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 -[ ] 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)-[ ] The main code file is located in gh-pages branch -[ ] Watch the complete youtube [GitHub Tutorial](https://stream.recodehive.com/github) Your contributions are highly appreciated! 😊 Don't forgot to follow me @sanjay-kv `More surprise when you raise PR`"
20+
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 on issue open"
33+
exit 1
34+
fi
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137

0 commit comments

Comments
 (0)