diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2189b5444..e9c89cc93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -593,19 +593,44 @@ jobs: cd python/interpret-core python -m pip install --upgrade black black --check . - - name: Mark step with a warning - if: ${{ steps.check_python.outcome == 'failure' }} - uses: actions/github-script@v6 - with: - script: | - github.rest.checks.update({ - owner: context.repo.owner, - repo: context.repo.repo, - check_run_id: check_python, - status: 'completed', - conclusion: 'neutral', - output: { - title: 'Black formatting check', - summary: 'The black formatting check failed but it is marked as neutral.', - } - }); + - name: Update check run to neutral if black format check fails + if: ${{ steps.check_python.outcome == 'failure' }} + uses: actions/github-script@v6 + with: + script: | + const result = await github.rest.checks.listForRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: context.sha + }); + const checkRun = result.data.check_runs.find(run => run.name === 'Check python matches black format'); + if (checkRun) { + await github.rest.checks.update({ + owner: context.repo.owner, + repo: context.repo.repo, + check_run_id: checkRun.id, + status: 'completed', + conclusion: 'neutral', + output: { + title: 'Black formatting check', + summary: 'The black formatting check failed but it is marked as neutral.', + } + }); + } + + # - name: Mark step with a warning + # if: ${{ steps.check_python.outcome == 'failure' }} + # uses: actions/github-script@v6 + # with: + # script: | + # github.rest.checks.update({ + # owner: context.repo.owner, + # repo: context.repo.repo, + # check_run_id: check_python, + # status: 'completed', + # conclusion: 'neutral', + # output: { + # title: 'Black formatting check', + # summary: 'The black formatting check failed but it is marked as neutral.', + # } + # });