From ee99cc43d57a89ad1d8f9375a8b6010b5b1a9565 Mon Sep 17 00:00:00 2001 From: matthieu-crouzet Date: Fri, 12 Apr 2024 10:21:05 +0200 Subject: [PATCH] feat: welcome developer for their first pr --- .github/workflows/first-pr.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/first-pr.yml diff --git a/.github/workflows/first-pr.yml b/.github/workflows/first-pr.yml new file mode 100644 index 0000000000..78c6cdb4c5 --- /dev/null +++ b/.github/workflows/first-pr.yml @@ -0,0 +1,32 @@ +name: First PR + +on: + pull_request: + types: + - opened + +permissions: + contents: read + +jobs: + audit: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v7 + id: my-script + with: + script: | + const reply = github.rest.issues.listForRepo({ + state: 'all', + creator: context.payload.pull_request.user.login + owner: context.repo.owner, + repo: context.repo.repo, + }); + const countPR = reply.data.filter((data) => data.pull_request).length; + github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.issue.number, + body: 'Thanks so much for opening your first PR here!' + countPR + }) +