-
-
Notifications
You must be signed in to change notification settings - Fork 27
37 lines (32 loc) · 1005 Bytes
/
merge_comment.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
35
36
37
name: Add merge comment
on:
pull_request_target:
types: [closed]
permissions:
contents: write
pull-requests: write
issues: write
jobs:
add-merge-comment:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Generate Comment
id: generate_comment
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pull_request = context.payload.pull_request;
const author = pull_request.user.login;
const issue_number = pull_request.number;
const body = `Thanks @${author} 🏆`;
console.log(`Generated comment: ${body}`);
core.setOutput('body', body);
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: ${{ steps.generate_comment.outputs.body }}
reactions: rocket