Skip to content

Commit ead9dbd

Browse files
committed
CI: don't attempt to commit formatting fixes to other branches
1 parent 6c9b552 commit ead9dbd

1 file changed

Lines changed: 2 additions & 24 deletions

File tree

.github/workflows/format.yml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
format:
1212
runs-on: ubuntu-latest
1313
permissions:
14-
contents: write
14+
contents: read
1515

1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@v6
1919

20-
- name: Setup LLVM 22
20+
- name: Setup LLVM
2121
uses: ZhongRuoyu/setup-llvm@v0
2222
with:
2323
llvm-version: 22
@@ -34,28 +34,6 @@ jobs:
3434
toolchain: nightly
3535
components: rustfmt, clippy, rustc-dev
3636

37-
- name: Apply C++ formatting fixes
38-
run: find cpp2rust tests -name '*.cpp' -o -name '*.h' -o -name '*.c' | xargs clang-format -i
39-
40-
- name: Apply Rust lint fixes
41-
run: |
42-
cargo clippy --fix --allow-dirty --manifest-path rules/Cargo.toml --all-targets
43-
cargo +nightly clippy --fix --allow-dirty --manifest-path rule-preprocessor/Cargo.toml --all-targets
44-
cargo clippy --fix --allow-dirty --manifest-path libcc2rs/Cargo.toml --all-targets
45-
46-
- name: Apply Rust formatting fixes
47-
run: |
48-
cargo fmt --manifest-path rules/Cargo.toml
49-
cargo fmt --manifest-path rule-preprocessor/Cargo.toml
50-
cargo fmt --manifest-path libcc2rs/Cargo.toml
51-
find tests -name '*.rs' -print0 | xargs -0 rustfmt
52-
53-
- name: Commit auto-fixes
54-
if: github.ref != 'refs/heads/master'
55-
uses: stefanzweifel/git-auto-commit-action@v5
56-
with:
57-
commit_message: "Automatically apply formatting and lint fixes"
58-
5937
- name: Check C++ formatting
6038
run: find cpp2rust tests -name '*.cpp' -o -name '*.h' -o -name '*.c' | xargs clang-format --dry-run --Werror
6139

0 commit comments

Comments
 (0)