From c6859bbc92bbbf33d6ffdc35182c76b43a8cccda Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Mon, 23 Jun 2025 16:43:31 +0800 Subject: [PATCH] WIP --- .github/workflows/pr-reply.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/pr-reply.yml diff --git a/.github/workflows/pr-reply.yml b/.github/workflows/pr-reply.yml new file mode 100644 index 000000000..7d342a29a --- /dev/null +++ b/.github/workflows/pr-reply.yml @@ -0,0 +1,32 @@ +# Let's vibe coding haha🐻 +# Use actions/github-script@v7 +# Reply a message to all new PRs +# The message: +# - Say hello and thanks to the contributor +# - Mention maintainers will review the PR soon +# - To other people, show the testing pr command: npx kuma-pr +# - Also show the advanced usage link: https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests +name: Reply to PRs +on: + pull_request: + types: [opened, reopened] +jobs: + reply: + runs-on: ubuntu-latest + steps: + - name: Reply to PR + uses: actions/github-script@v7 + with: + script: | + const pr = context.payload.pull_request; + const message = `Hello @${pr.user.login}, thank you for your contribution! :tada:\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` + + `\`\`\`bash\nnpx kuma-pr ${pr.user.login}/${pr.head.ref}\n\`\`\`\n\n` + + `For advanced usage, please refer to our [wiki](https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests)`; + await github.rest.issues.createComment({ + issue_number: pr.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: message + });