Skip to content

Commit 8e48008

Browse files
committed
replace auto commit to format suggestion
1 parent fc1c278 commit 8e48008

File tree

2 files changed

+56
-122
lines changed

2 files changed

+56
-122
lines changed

.github/workflows/pr-auto-commit.yaml

Lines changed: 0 additions & 122 deletions
This file was deleted.

.github/workflows/pr-format.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Format Check
2+
3+
# This workflow triggers when a PR is opened/updated
4+
# Posts inline suggestion comments instead of auto-committing
5+
on:
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
branches:
9+
- main
10+
- release
11+
12+
concurrency:
13+
group: format-check-${{ github.event.pull_request.number }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
format_check:
18+
permissions:
19+
contents: read
20+
pull-requests: write
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 60
23+
steps:
24+
- name: Checkout PR branch
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Rust
28+
uses: dtolnay/rust-toolchain@stable
29+
with:
30+
components: rustfmt
31+
32+
- name: Run cargo fmt
33+
run: cargo fmt --all
34+
35+
- name: Install ruff
36+
uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v3.6.1
37+
with:
38+
version: "0.15.4"
39+
args: "--version"
40+
41+
- name: Run ruff format
42+
run: ruff format
43+
44+
- name: Run ruff check import sorting
45+
run: ruff check --select I --fix
46+
47+
- name: Run generate_opcode_metadata.py
48+
run: python scripts/generate_opcode_metadata.py
49+
50+
- name: Post formatting suggestions
51+
uses: reviewdog/action-suggester@v1
52+
with:
53+
tool_name: auto-format
54+
github_token: ${{ secrets.GITHUB_TOKEN }}
55+
level: warning
56+
filter_mode: diff_context

0 commit comments

Comments
 (0)