Skip to content

Commit

Permalink
post-pr
Browse files Browse the repository at this point in the history
  • Loading branch information
ANSHIKA-26 committed Oct 3, 2024
1 parent fc884fc commit 5648303
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/post_pr_thankyou.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: Post-PR Merge Thank You

on:
pull_request:
types: [closed] # This will trigger the workflow when a PR is closed
pull_request_target:
types: [closed] # Trigger when a PR is closed

permissions:
issues: write
pull-requests: write


jobs:
post_merge_message:
if: github.event.pull_request.merged == true # Only run if the PR was merged
Expand All @@ -18,15 +17,16 @@ jobs:
- name: Post thank you message
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }} # Ensure token is used
script: |
const prNumber = context.payload.pull_request.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
// Post a cute thank you message
// Post a thank you message upon PR merge
await github.rest.issues.createComment({
owner: owner,
repo: repo,
issue_number: prNumber,
body: `πŸŽ‰πŸŽ‰ Thank you for your contribution! Your PR has been merged !πŸŽ‰πŸŽ‰`
body: `πŸŽ‰πŸŽ‰ Thank you for your contribution! Your PR #${prNumber} has been merged! πŸŽ‰πŸŽ‰`
});

0 comments on commit 5648303

Please sign in to comment.