From d7659ce93a87da4a57c94d3e2874d33c1490b2f2 Mon Sep 17 00:00:00 2001 From: Peter Hu Date: Mon, 12 Dec 2022 09:16:36 -0800 Subject: [PATCH] Workflow for Approval Bot Dispatch --- .../workflows/approve-and-merge-dispatch.yml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/approve-and-merge-dispatch.yml diff --git a/.github/workflows/approve-and-merge-dispatch.yml b/.github/workflows/approve-and-merge-dispatch.yml new file mode 100644 index 0000000000000..8c7e212a3be80 --- /dev/null +++ b/.github/workflows/approve-and-merge-dispatch.yml @@ -0,0 +1,36 @@ +name: Approve and Merge Command Dispatch +on: + issue_comment: + types: [created] +jobs: + approveAndMergeDispatch: + runs-on: ubuntu-latest + steps: + - name: Checkout Airbyte + uses: actions/checkout@v3 + - name: Check PAT rate limits + run: | + ./tools/bin/find_non_rate_limited_PAT \ + ${{ secrets.AIRBYTEIO_PAT }} \ + ${{ secrets.OCTAVIA_GITHUB_RUNNER_TOKEN }} \ + ${{ secrets.SUPERTOPHER_PAT }} + + - name: Auto Approve Slash Command Dispatch + uses: peter-evans/slash-command-dispatch@v3 + id: scd + with: + token: ${{ env.PAT }} + permission: write + issue-type: pull-request + repository: airbytehq/airbyte-cloud + dispatch-type: repository + commands: | + approve-and-merge + + - name: Edit comment with error message + if: steps.scd.outputs.error-message + uses: peter-evans/create-or-update-comment@v1 + with: + comment-id: ${{ github.event.comment.id }} + body: | + > Error: ${{ steps.scd.outputs.error-message }}