adding nestjs-bullmq-postgres kit to main site #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Thank contributor for contribution' | |
on: | |
pull_request: | |
types: | |
- closed | |
jobs: | |
Congratulate: | |
if: github.event.pull_request.merged == true && | |
github.event.pull_request.user.login != 'dependabot[bot]' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Sleep for 120 seconds | |
run: sleep 120s | |
shell: bash | |
- name: Thank contributor for contribution | |
env: | |
ISSUES_BOT_TOKEN: ${{ secrets.ISSUES_BOT_TOKEN }} | |
run: | | |
username="${{ github.event.pull_request.user.login }}" | |
repo="${{ github.repository }}" | |
if [[ "$username" =~ [[:punct:]] ]]; then | |
message="Hi @$username. :wave:\n\nYour PR has been approved and merged. :tada:\n\nThank you for your contribution to starter.dev. :heart:\n\nKeep up the great work!" | |
else | |
response=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $ISSUES_BOT_TOKEN" "https://api.github.com/repos/$repo/collaborators/$username") | |
if [ "$response" = "204" ]; then | |
message="Hi @$username. :wave:\n\nYour PR has been approved and merged. :tada:\n\nThank you for your continued contributions to starter.dev. :heart:\n\nKeep up the great work!" | |
elif [ "$response" = "404" ]; then | |
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 starter.dev. :heart:\n\nWe look forward to your next contribution. :rocket:" | |
else | |
echo "Invalid or expired token: $ISSUES_BOT_TOKEN" | |
exit 1 | |
fi | |
fi | |
curl -X POST \ | |
-H "Authorization: Bearer $ISSUES_BOT_TOKEN" \ | |
-H "Content-Type: application/json" \ | |
-d '{ | |
"body": "'"$message"'" | |
}' \ | |
"https://api.github.com/repos/$repo/issues/${{ github.event.pull_request.number }}/comments" |