From 1432b08311fe0a1408dc5d37b408a142f7091e34 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Tue, 28 Jun 2022 14:00:03 -0700 Subject: [PATCH 1/2] Make preDeploy continue if lint and test succeed --- .github/workflows/preDeploy.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 363c0f619b28..143f5878e227 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -14,14 +14,17 @@ jobs: confirmPassingBuild: runs-on: ubuntu-latest needs: [lint, test] - if: ${{ always() && (needs.lint.result == 'failure' || needs.test.result == 'failure') }} + if: ${{ always() }} steps: + - id: didBuildFail + run: echo "::set-output name=DID_BUILD_FAIL::${{ needs.lint.result == 'failure' || needs.test.result == 'failure' }}" + # This Slack step is duplicated in all workflows, if you make a change to this step, make sure to update all # the other workflows with the same change - uses: 8398a7/action-slack@v3 name: Job failed Slack notification - if: ${{ failure() }} + if: ${{ fromJSON(steps.didBuildFail.DID_BUILD_FAIL) }} with: status: custom fields: workflow, repo @@ -38,6 +41,9 @@ jobs: GITHUB_TOKEN: ${{ github.token }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + - if: ${{ fromJSON(steps.didBuildFail.DID_BUILD_FAIL) }} + run: exit 1 + chooseDeployActions: runs-on: ubuntu-latest needs: confirmPassingBuild From 25da7eeb91c5bf69096b82d9e3ae2ff330e30a73 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Tue, 28 Jun 2022 14:21:04 -0700 Subject: [PATCH 2/2] Make actionlint happy --- .github/workflows/preDeploy.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 143f5878e227..791b02d86233 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -17,14 +17,11 @@ jobs: if: ${{ always() }} steps: - - id: didBuildFail - run: echo "::set-output name=DID_BUILD_FAIL::${{ needs.lint.result == 'failure' || needs.test.result == 'failure' }}" - # This Slack step is duplicated in all workflows, if you make a change to this step, make sure to update all # the other workflows with the same change - uses: 8398a7/action-slack@v3 name: Job failed Slack notification - if: ${{ fromJSON(steps.didBuildFail.DID_BUILD_FAIL) }} + if: ${{ needs.lint.result == 'failure' || needs.test.result == 'failure' }} with: status: custom fields: workflow, repo @@ -41,7 +38,7 @@ jobs: GITHUB_TOKEN: ${{ github.token }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - - if: ${{ fromJSON(steps.didBuildFail.DID_BUILD_FAIL) }} + - if: ${{ needs.lint.result == 'failure' || needs.test.result == 'failure' }} run: exit 1 chooseDeployActions: