diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 24c368b..c10705d 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -1,16 +1,46 @@ -name: 🤖 Auto approve by bot +name: 🤖 Auto approve validation on: pull_request +env: + JOBS_NAME: '[ "ci" ]' + jobs: - automated-pull-request: + setup: runs-on: ubuntu-latest - permissions: - pull-requests: write + outputs: + matrix: ${{ steps.matrix.outputs.value }} steps: - - uses: actions/checkout@v4.1.0 + - uses: taiga-family/ci/actions/setup/checkout@v1.24.1 - uses: taiga-family/ci/actions/setup/variables@v1.24.1 - - uses: taiga-family/ci/actions/auto/approve/double@v1.24.1 + - id: matrix if: env.TAIGA_FAMILY_BOT_IS_AUTHOR == 'true' + run: echo "value=$JOBS_NAME" >> $GITHUB_OUTPUT + + wait: + needs: [setup] + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + value: ${{ fromJSON(needs.setup.outputs.matrix) }} + steps: + - uses: taiga-family/ci/actions/run/wait-job@v1.24.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + job: ${{ matrix.value }} + + approve: + needs: [wait] + runs-on: ubuntu-latest + steps: + - uses: taiga-family/ci/actions/auto/approve/double@v1.24.1 with: token1: ${{ secrets.GITHUB_TOKEN }} token2: ${{ secrets.TAIGA_FAMILY_APPROVE_BOT_PAT }} + - uses: taiga-family/ci/actions/run/merge@v1.25.1 + with: + token: ${{ secrets.TAIGA_FAMILY_APPROVE_BOT_PAT }} + +concurrency: + group: auto-approve-${{ github.head_ref }} + cancel-in-progress: true