Skip to content

1t

1t #12

name: Thank PR Author
on:
pull_request_target:
types:
- closed
- opened
- edited
- synchronize
- reopened
permissions:
pull-requests: write
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:
github-token: ${{ secrets.GITHUB_TOKEN }}
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
});