diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c57a9c1df..37d6fa364 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -495,31 +495,37 @@ jobs: find shared/libebm \( -iname "*.cpp" -o -iname "*.h" -o -iname "*.hpp" \) | xargs clang-format-16 -i -style=file git diff --exit-code - format_black: - runs-on: ubuntu-latest - steps: - - name: Check out repo - uses: actions/checkout@v4 - - name: Check python matches black format - continue-on-error: true - run: | - cd python/interpret-core - python -m pip install --upgrade black - black --check . - - name: Mark step with a warning - if: steps.black_check.outputs.exitcode != '0' - uses: actions/github-script@v6 - with: - script: | - github.rest.checks.create({ - owner: context.repo.owner, - repo: context.repo.repo, - name: 'Warning: Step might have failed', - head_sha: context.sha, - status: 'completed', - conclusion: 'neutral', - output: { - title: 'Warning', - summary: 'The previous step failed but the workflow continued.' - } + format_black: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v4 + - name: Check python matches black format + id: black_check + continue-on-error: true + run: | + cd python/interpret-core + python -m pip install --upgrade black + black --check . + shell: bash + - name: Capture exit code + id: capture_exit_code + run: echo "::set-output name=exitcode::${{ steps.black_check.outcome == 'failure' }}" + - name: Mark step with a warning + if: steps.capture_exit_code.outputs.exitcode == 'true' + uses: actions/github-script@v6 + with: + script: | + github.rest.checks.create({ + owner: context.repo.owner, + repo: context.repo.repo, + name: 'Warning: Step might have failed', + head_sha: context.sha, + status: 'completed', + conclusion: 'neutral', + output: { + title: 'Warning', + summary: 'The previous step failed but the workflow continued.' + } }) +