From 184397a3272a080e5618c1798819fce470424ced Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 15 Apr 2022 19:14:23 +0200 Subject: [PATCH] Adds PR first response action --- .github/workflows/pr-first-response.yml | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/pr-first-response.yml diff --git a/.github/workflows/pr-first-response.yml b/.github/workflows/pr-first-response.yml new file mode 100644 index 0000000000..f54c8b91ba --- /dev/null +++ b/.github/workflows/pr-first-response.yml @@ -0,0 +1,26 @@ +name: pr-first-response + +on: + pull_request: + types: [opened] + +jobs: + send-response: + runs-on: ubuntu-latest + steps: + - name: Fetch random comment 🗣️ + uses: JamesIves/fetch-api-data-action@v2.1.0 + with: + ENDPOINT: https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment + CONFIGURATION: '{ "method": "POST", "headers": {"Authorization": "Bearer ${{ secrets.OUR_BOT_API_TOKEN }}", "Content-Type": "application/json" }, "body": { "repo": "${{ github.repository }}", "number": "${{ github.event.number }}", "actor": "${{ github.actor }}", "commentType": "opened-pr-first-comment"} }' + - name: Add PR comment + if: "${{ env.fetch-api-data != '' }}" + uses: actions/github-script@v5 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `${{ env.fetch-api-data }}` + }) \ No newline at end of file