This commit is contained in:
Louis Lam 2025-06-23 21:37:19 +08:00
parent 9e7ea4913a
commit 7e8217192e

View file

@ -6,31 +6,31 @@
# - Also show the advanced usage link: https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests # - Also show the advanced usage link: https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests
name: Reply to PRs name: Reply to PRs
on: on:
pull_request: pull_request_target:
types: [opened, reopened] types: [ opened, reopened ]
permissions: permissions:
issues: write issues: write
pull-requests: write pull-requests: write
contents: read contents: read
jobs: jobs:
reply: reply:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Reply to PR - name: Reply to PR
uses: actions/github-script@v7 uses: actions/github-script@v7
with: with:
script: | script: |
const pr = context.payload.pull_request; const pr = context.payload.pull_request;
const message = `Hello @${pr.user.login}, thank you for your contribution! :tada:\n` + const message = `Hello @${pr.user.login}, thank you for your contribution! :tada:\n` +
`The maintainers will review your PR soon.\n\n` + `The maintainers will review your PR soon.\n\n` +
`If anyone would like to help test this PR, you can use the command:\n` + `If anyone would like to help test this PR, you can use the command:\n` +
`\`\`\`bash\nnpx kuma-pr ${pr.user.login}:${pr.head.ref}\n\`\`\`\n\n` + `\`\`\`bash\nnpx kuma-pr ${pr.user.login}:${pr.head.ref}\n\`\`\`\n\n` +
`<sub> For advanced usage, please refer to our [wiki](https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests) </sub>`; `<sub> For advanced usage, please refer to our [wiki](https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests) </sub>`;
await github.rest.issues.createComment({ await github.rest.issues.createComment({
issue_number: pr.number, issue_number: pr.number,
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
body: message body: message
}); });