-
Notifications
You must be signed in to change notification settings - Fork 28
34 lines (27 loc) · 1009 Bytes
/
pr-merge.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Merge Thank You
on:
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
runs-on: ubuntu-latest
steps:
- 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 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 #${prNumber} has been merged! 🎉🎉`
});