diff --git a/.github/workflows/approbe.yml b/.github/workflows/approbe.yml new file mode 100644 index 00000000..0937a141 --- /dev/null +++ b/.github/workflows/approbe.yml @@ -0,0 +1,33 @@ +name: Approve + +on: + pull_request: + types: [labeled] + +jobs: + approve: + runs-on: ubuntu-latest + timeout-minutes: 1 + if: >- + ${{ + github.event.label.name == 'Bypass review' && + github.event.pull_request.user.login == 'na2na-p' + }} + env: + NUMBER: ${{ github.event.number }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4.1.1 + - name: Generate github token + id: generate_token + uses: tibdex/github-app-token@v2.1.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + env: + OPENSSL_CONF: /dev/null + - name: Approve + run: gh pr review ${{ env.NUMBER }} --approve + env: + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}