diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d62855da..1898601b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -638,3 +638,38 @@ jobs: # summary: 'The black formatting check failed but it is marked as neutral.', # } # }); + + format_black_adjust: + needs: [format_black] + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v4 + - 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 + }); + console.log("Check runs found:", result.data.check_runs.map(run => run.name)); + const checkRun = result.data.check_runs.find(run => run.name === 'format_black'); + if (checkRun) { + console.log("Updating check run with ID:", checkRun.id); + 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.', + } + }); + } else { + console.log("No matching check run found."); + }