test pr2 #8
Workflow file for this run
This file contains hidden or 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 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: | |
github-token: ${{ secrets.PR_COMMENT_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 | |
}); |