Fix pr-format CI to fail on formatting changes

Add git diff --exit-code step to fail the check when
formatters produce changes. Previously reviewdog only
posted suggestions without failing the workflow.
This commit is contained in:
Jeong, YunWon committed 2026-03-13 01:19:10 +09:00
1 parent 61b3b4f42b
commit bdfe2cf923
1 file changed
+8
+8
View File
@@ -47,7 +47,15 @@ jobs:
- name: Run generate_opcode_metadata.py
run: python scripts/generate_opcode_metadata.py
- name: Check for formatting changes
run: |
if ! git diff --exit-code; then
echo "::error::Formatting changes detected. Please run 'cargo fmt --all', 'ruff format', and 'ruff check --select I --fix' locally."
exit 1
fi
- name: Post formatting suggestions
if: failure()
uses: reviewdog/action-suggester@v1
with:
tool_name: auto-format