-
Notifications
You must be signed in to change notification settings - Fork 240
50 lines (41 loc) · 1.51 KB
/
auto-comment-pr.yml
File metadata and controls
50 lines (41 loc) · 1.51 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Auto Comment on PR
permissions:
contents: read
pull-requests: write
on:
pull_request_target:
types: [ opened, synchronize ]
branches: [ main ]
jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create a comment
uses: actions/github-script@v7
with:
github-token: ${{ secrets.BOT_TOKEN }}
script: |
const { owner, repo, number: issue_number } = context.issue;
// Get PR creator's username
const prCreator = context.payload.pull_request.user.login;
const commentBody = `
🔊@${prCreator} 🚀Thanks for your contribution🎉!
💡CodeRabbit(AI) will review your code first🔥!
> [!NOTE]
>
> 🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥.
`;
github.rest.issues.createComment({
owner,
repo,
issue_number,
body: commentBody
});
github.rest.issues.addLabels({
owner,
repo,
issue_number,
labels: ['ready to review','waiting-review','AI review first','auto merge']
});