Skip to content

Commit

Permalink
Optionally skip the CI pipeline if the PR contains the skip-ci label (#…
Browse files Browse the repository at this point in the history
…426)

* Adds a new `has_skip_ci_label` output to the `prepare` job.
* Skips the rest of the pipeline when true

Authors:
  - David Gardner (https://github.com/dagardner-nv)

Approvers:
  - Michael Demoret (https://github.com/mdemoret-nv)

URL: #426
  • Loading branch information
dagardner-nv authored Dec 22, 2023
1 parent d12e95e commit 368fe7a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ jobs:
- ci_pipe
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
checks:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
enable_check_generated_files: false
prepare:
name: Prepare
runs-on: ubuntu-latest
Expand All @@ -70,11 +65,22 @@ jobs:
is_main_branch: ${{ github.ref_name == 'main' }}
is_dev_branch: ${{ startsWith(github.ref_name, 'branch-') }}
has_conda_build_label: ${{ steps.get-pr-info.outcome == 'success' && contains(fromJSON(steps.get-pr-info.outputs.pr-info).labels.*.name, 'conda-build') || false }}
has_skip_ci_label: ${{ steps.get-pr-info.outcome == 'success' && contains(fromJSON(steps.get-pr-info.outputs.pr-info).labels.*.name, 'skip-ci') || false }}
pr_info: ${{ steps.get-pr-info.outcome == 'success' && steps.get-pr-info.outputs.pr-info || '' }}

checks:
needs: [prepare]
if: ${{ ! fromJSON(needs.prepare.outputs.has_skip_ci_label) }}
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
enable_check_generated_files: false

ci_pipe:
name: CI Pipeline
needs: [prepare]
uses: ./.github/workflows/ci_pipe.yml
if: ${{ ! fromJSON(needs.prepare.outputs.has_skip_ci_label) }}
with:
# Run checks for any PR branch
run_check: ${{ fromJSON(needs.prepare.outputs.is_pr) }}
Expand Down

0 comments on commit 368fe7a

Please sign in to comment.