diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index ebb8e3310..db452829a 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -9,6 +9,46 @@ jobs: steps: - uses: taiga-family/ci/actions/setup/checkout@v1.23.0 - uses: taiga-family/ci/actions/setup/variables@v1.23.0 + - name: Wait for build to succeed + uses: fountainhead/action-wait-for-check@v1.1.0 + id: wait1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + checkName: build + ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Wait for build to succeed + if: steps.wait1.outputs.conclusion == 'success' + uses: fountainhead/action-wait-for-check@v1.1.0 + id: wait2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + checkName: build-demo + ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Wait for build to succeed + if: steps.wait2.outputs.conclusion == 'success' + uses: fountainhead/action-wait-for-check@v1.1.0 + id: wait3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + checkName: lint + ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Wait for build to succeed + if: steps.wait3.outputs.conclusion == 'success' + uses: fountainhead/action-wait-for-check@v1.1.0 + id: wait-for-build + with: + token: ${{ secrets.GITHUB_TOKEN }} + checkName: tests + ref: ${{ github.event.pull_request.head.sha || github.sha }} + + - name: Do something with a passing build + if: steps.wait-for-build.outputs.conclusion == 'success' + run: echo 'success' + + - name: Do something with a failing build + if: steps.wait-for-build.outputs.conclusion == 'failure' + run: echo 'failure' + - uses: taiga-family/ci/actions/auto/approve/double@v1.23.0 if: env.TAIGA_FAMILY_BOT_IS_AUTHOR == 'true' with: diff --git a/.github/workflows/auto-wait-successful.yml b/.github/workflows/auto-wait-successful.yml deleted file mode 100644 index 653fb5d6d..000000000 --- a/.github/workflows/auto-wait-successful.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: 🤖 Auto approve when success - -on: - workflow_run: - workflows: ['⚙️ Build demo', '⚙️ Build lib', '⚙️ Lint', '⚙️ Tests'] - types: - - completed - -jobs: - on-success: - runs-on: ubuntu-latest - steps: - - run: echo 'The triggering workflow passed' - - run: echo '${{ github.event.workflow_run.conclusion }}' - - run: echo '${{ github.ref }}' - - uses: taiga-family/ci/actions/setup/checkout@v1.23.0 - - uses: taiga-family/ci/actions/setup/variables@v1.23.0 - - uses: taiga-family/ci/actions/auto/approve/double@v1.23.0 - if: env.TAIGA_FAMILY_BOT_IS_AUTHOR == 'true' - with: - token1: ${{ secrets.GITHUB_TOKEN }} - token2: ${{ secrets.TAIGA_FAMILY_APPROVE_BOT_PAT }} - - on-failure: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'failure' && github.ref != 'refs/heads/main' }} - steps: - - run: echo 'The triggering workflow failed' - - uses: actions/github-script@v5 - continue-on-error: true - with: - github-token: ${{ github.token }} - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '⛔ Some workflows failed, we can’t use auto approve for here!' - }) diff --git a/.github/workflows/build-demo.yml b/.github/workflows/build-demo.yml index fece4f74f..e8fd45cf5 100644 --- a/.github/workflows/build-demo.yml +++ b/.github/workflows/build-demo.yml @@ -6,7 +6,7 @@ on: - main jobs: - build: + build-demo: runs-on: ubuntu-latest steps: - uses: taiga-family/ci/actions/setup/checkout@v1.23.0