Skip to content

Commit 86f8d17

Browse files
tttt
1 parent 45b5b84 commit 86f8d17

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

.github/workflows/auto-comment-pr.yml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Auto Comment on PR
22

33
on:
44
pull_request_target:
5-
branches: [ "main"]
65
types: [ opened, synchronize ]
76

87
jobs:
+20-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
name: Auto Request Review
1+
name: Auto Comment on PR
22

33
on:
4-
pull_request:
5-
types: [ opened, ready_for_review, reopened, synchronize ]
4+
pull_request_target:
5+
types: [ opened, synchronize ]
66

77
jobs:
8-
auto-request-review:
9-
name: Auto Request Review
8+
comment:
109
runs-on: ubuntu-latest
10+
1111
steps:
12-
- name: Request review based on files changes and/or groups the author belongs to
13-
uses: necojackarc/[email protected]
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Create a comment
16+
uses: actions/github-script@v7
1417
with:
15-
token: ${{ secrets.GITHUB_TOKEN }}
16-
config: .github/reviewers.yml # Config file location override
17-
# Look for config locally during run instead of in repo.
18-
# For instance, if you'd like to use a config file stored in external storage,
19-
# you can fetch it before you run this action, then let this action pick it up with `use_local: true`.
20-
# This defaults to false if not specified.
21-
# See https://github.com/necojackarc/auto-request-review/issues/76 for more details.
22-
use_local: false
18+
github-token: ${{ secrets.PAT_TOKEN }}
19+
script: |
20+
const { owner, repo, number: issue_number } = context.issue;
21+
const commentBody = "Please review this PR.";
22+
github.rest.issues.createComment({
23+
owner,
24+
repo,
25+
issue_number,
26+
body: commentBody
27+
});

.github/workflows/automerge.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Auto Merge PR
22
on:
3-
pull_request:
3+
pull_request_target:
44
types:
55
- labeled
66
- synchronize
@@ -13,7 +13,7 @@ jobs:
1313
- name: automerge
1414
uses: "pascalgn/[email protected]"
1515
env:
16-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
16+
GITHUB_TOKEN: "${{ secrets.PAT_TOKEN }}"
1717
MERGE_LABELS: "approved,auto merge"
1818
MERGE_METHOD: "squash"
1919
MERGE_COMMIT_MESSAGE: "pull-request-title"

0 commit comments

Comments
 (0)