From f0091c9d79c0943f8360c547b80ccd2f54512262 Mon Sep 17 00:00:00 2001 From: Pey Lian Lim <2090236+pllim@users.noreply.github.com> Date: Fri, 8 Jan 2021 19:07:18 -0500 Subject: [PATCH] TST: Skip CI without fail [ci skip] --- .github/workflows/ci_workflows.yml | 9 ++++++++- .github/workflows/codeql-analysis.yml | 10 ++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_workflows.yml b/.github/workflows/ci_workflows.yml index cfb1249c..cf4400f9 100644 --- a/.github/workflows/ci_workflows.yml +++ b/.github/workflows/ci_workflows.yml @@ -12,19 +12,24 @@ jobs: cancel_ci: name: Mandatory checks before CI runs-on: ubuntu-latest + outputs: + run_next: ${{ steps.skip_ci_step.outputs.run_next }} steps: # Base branch check should run whether we skip CI or not - name: Check base branch uses: pllim/action-check_pr_basebranch@main with: BASEBRANCH_NAME: master - - name: Failure means CI is skipped on purpose + - name: Check skip CI uses: pllim/action-skip-ci@main + id: skip_ci_step with: + NO_FAIL: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This should only run if we did not skip CI - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@ce17749 + if: steps.skip_ci_step.outputs.run_next == 'true' with: access_token: ${{ secrets.GITHUB_TOKEN }} @@ -33,6 +38,7 @@ jobs: pep_and_audit: runs-on: ubuntu-latest needs: cancel_ci + if: needs.cancel_ci.outputs.run_next == 'true' steps: - name: Checkout code uses: actions/checkout@v2 @@ -60,6 +66,7 @@ jobs: link_check: runs-on: ubuntu-latest needs: cancel_ci + if: needs.cancel_ci.outputs.run_next == 'true' steps: - name: Checkout code uses: actions/checkout@v2 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e55ffda7..ccef9fd5 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -20,16 +20,21 @@ on: jobs: cancel_ci: - name: Failure means CI cancelled on purpose + name: Mandatory checks before CI runs-on: ubuntu-latest + outputs: + run_next: ${{ steps.skip_ci_step.outputs.run_next }} steps: - - name: Failure means CI is skipped on purpose + - name: Check skip CI uses: pllim/action-skip-ci@main + id: skip_ci_step with: + NO_FAIL: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This should only run if we did not skip CI - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@ce17749 + if: steps.skip_ci_step.outputs.run_next == 'true' with: access_token: ${{ secrets.GITHUB_TOKEN }} @@ -38,6 +43,7 @@ jobs: analyze: name: Analyze needs: cancel_ci + if: needs.cancel_ci.outputs.run_next == 'true' runs-on: ubuntu-latest strategy: