From 7b9fb602a6b4282a111b2f866abd64bb187e87bd Mon Sep 17 00:00:00 2001 From: Rob Anderson Date: Wed, 20 Nov 2024 17:35:36 -0800 Subject: [PATCH] workflow to review probot PRs (#149) --- .github/workflows/review-probot-prs.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/review-probot-prs.yml diff --git a/.github/workflows/review-probot-prs.yml b/.github/workflows/review-probot-prs.yml new file mode 100644 index 0000000..3cae2c9 --- /dev/null +++ b/.github/workflows/review-probot-prs.yml @@ -0,0 +1,25 @@ +name: Review Probot PRs +on: + pull_request: + types: [opened, reopened] +jobs: + bot: + runs-on: ubuntu-latest + steps: + - name: Post review + if: startsWith(github.event.pull_request.title, 'Bump probot') || startsWith(github.event.pull_request.title, 'Bump @probot') + uses: actions/github-script@v7.0.1 + with: + script: | + const pull_number = context.payload.pull_request.number; + const owner = context.repo.owner; + const repo = context.repo.repo; + + await github.request(`POST /repos/${owner}/${repo}/pulls/${pull_number}/reviews`, { + owner: owner, + repo: repo, + pull_number: pull_number, + body: '👋🏻🤖 The latest probot uses a newer octokit, which is not compatible with nock.\n\n' + + 'The latest version of octokit uses [undici http client](https://github.com/nodejs/undici). Nock does not support undici. More details [here](https://github.com/nock/nock/issues/2183).', + event: 'REQUEST_CHANGES' + });