Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/pr_thanks_action.yaml
Original file line number Diff line number Diff line change
@@ -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
});