Sitelet https://github.com/thisdot/framework.dev/commit/cef38b8cd1d6516b12ded2b9c0d26dfeab3bd7c8
Skip to content

Commit cef38b8

Browse files
authored
Update thank-contributor.yml (#777)
1 parent 9719eaa commit cef38b8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎.github/workflows/thank-contributor.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,23 @@ jobs:
2020
username="${{ github.event.pull_request.user.login }}"
2121
repo="${{ github.repository }}"
2222
if [[ "$username" =~ [[:punct:]] ]]; then
23+
echo "User has punctuation in the name, so opting for a generic message"
2324
message="Hi @$username. :wave:\n\nYour PR has been approved and merged. :tada:\n\nThank you for your contribution to framework.dev. :heart:\n\nKeep up the great work!"
2425
else
26+
echo "fetching user from org to see if he contributed before"
2527
response=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $ISSUES_BOT_TOKEN" "https://api.github.com/repos/$repo/collaborators/$username")
2628
if [ "$response" = "204" ]; then
29+
echo "Returning user"
2730
message="Hi @$username. :wave:\n\nYour PR has been approved and merged. :tada:\n\nThank you for your continued contributions to framework.dev. :heart:\n\nKeep up the great work!"
2831
elif [ "$response" = "404" ]; then
32+
echo "New User"
2933
message="Hi @$username. :wave:\n\nCongrats on your first PR being approved and merged! :tada:\n\nThank you for taking the time to contribute to framework.dev. :heart:\n\nWe look forward to your next contribution. :rocket:"
3034
else
3135
echo "Invalid or expired token: $ISSUES_BOT_TOKEN"
3236
exit 1
3337
fi
3438
fi
39+
echo "Writing message on the ticket"
3540
curl -X POST \
3641
-H "Authorization: Bearer $ISSUES_BOT_TOKEN" \
3742
-H "Content-Type: application/json" \

0 commit comments

Comments
 (0)