Skip to content

Commit

Permalink
added thankyou note github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Feb 28, 2023
1 parent 39000ec commit 284654e
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/thank-you.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Say thanks for the contributors

on:
pull_request:
types:
- closed

jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
permissions:
issues: write
steps:
- name: Add thankyou note
uses: actions/[email protected]
with:
script: |
const thankyouNote = 'We truly appreciate your efforts. Thank you for taking the time to contribute, this is a very valuable contribution to us :1st_place_medal:. We always welcome your contribution :slightly_smiling_face:, so feel free to contribute to anything anytime, and never lose that spirit of innovation :raised_hands:.'
const options = {
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
}
const result = await github.rest.issues.get({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
})
const { assignees } = result.data
if (assignees.length == 0) {
await github.rest.issues.createComment({ ...options, body })
return
}
const assignees_tagged = assignees.map((user) => '@' + user.login).join(' ')
await github.rest.issues.createComment({
...options,
body: `${assignees_tagged} ${thankyouNote}`,
})

0 comments on commit 284654e

Please sign in to comment.