diff --git a/.github/workflows/pr_thanks_action.yaml b/.github/workflows/pr_thanks_action.yaml new file mode 100644 index 00000000..a7760005 --- /dev/null +++ b/.github/workflows/pr_thanks_action.yaml @@ -0,0 +1,39 @@ +name: Thank PR Author + +on: + pull_request: + types: + - closed + +jobs: + thank-author: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Post a themed thank you comment + uses: actions/github-script@v7 + with: + script: | + const prNumber = context.payload.pull_request.number; + const author = context.payload.pull_request.user.login; + + const messages = [ + `🌌 **Houston, we have a merge!**\n@${author}, your PR just launched our codebase into another galaxy. πŸš€ Thanks, space cadet! πŸ‘©β€πŸš€`, + + `🐾 **Purr-fect!**\n@${author}, your PR was smoother than a cat nap in the sun. Thanks for being pawsome! 😸🐾`, + + `πŸ“Έ **"One does not simply... forget to thank @${author}."**\nYour code was strong, your style stronger. Much appreciated! πŸ’ͺπŸ’»`, + + `πŸ΄β€β˜ οΈ **Ahoy, @${author}!**\nYer PR be merged with no bugs in sight. Ye be a true swashbucklin’ dev! ☠️🦜 Thanks, matey!`, + + `🎭 **Hark!**\nThou, @${author}, hath deliver'd thy pull request with great care and valor. Verily, we thank thee! πŸ“πŸ™‡β€β™‚οΈ` + ]; + + const message = messages[Math.floor(Math.random() * messages.length)]; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: prNumber, + body: message + });