diff --git a/.github/workflows/approve-and-merge-dispatch.yml b/.github/workflows/approve-and-merge-dispatch.yml new file mode 100644 index 000000000000..8c7e212a3be8 --- /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 }}