Skip to content

Commit

Permalink
ci: Change format warning to notice, and succeed the job if step fails
Browse files Browse the repository at this point in the history
Github only has 2 states for the result of a job, either success or
error. A warning state would be nice but isn't available.

We still add a notice to changed files to suggest contributors to
format.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
  • Loading branch information
pdgendt committed Dec 2, 2024
1 parent 5eacc04 commit 1a4d8d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ jobs:
needs: find-changed-files
if: ${{ needs.find-changed-files.outputs.files != '[]' }}
runs-on: ubuntu-latest
# Allow the workflow run to pass when this job fails
continue-on-error: true
strategy:
fail-fast: false
matrix:
Expand All @@ -56,6 +54,8 @@ jobs:

- name: Run ruff format check for ${{ matrix.files.path }}
uses: astral-sh/ruff-action@v1
# Allow the job run to pass when this step fails
continue-on-error: true
with:
args: "format --check --diff"
src: "${{ matrix.files.path }}"
Expand All @@ -64,4 +64,4 @@ jobs:
- name: Annotate unformatted file
if: ${{ failure() }}
run: |
echo "::warning file=${{ matrix.files.path }},title=File format check failed::Run 'ruff format ${{ matrix.files.path }}'"
echo "::notice file=${{ matrix.files.path }},title=Unformatted file::Consider running 'ruff format ${{ matrix.files.path }}'"

0 comments on commit 1a4d8d5

Please sign in to comment.