From ca5845c2f65dbf1198e6472fd9734c96af1dae5e Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 11 Jan 2024 21:24:14 +0800 Subject: [PATCH] checkout the `main` rustfmt.toml prior to running CI this is necessary so that patches can't sneak through by modifying rustfmt.toml to bypass a CI checke. --- .github/workflows/rustfmt_check.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rustfmt_check.yml b/.github/workflows/rustfmt_check.yml index 1d0d4e52c..38626bca0 100644 --- a/.github/workflows/rustfmt_check.yml +++ b/.github/workflows/rustfmt_check.yml @@ -13,6 +13,9 @@ jobs: rustup toolchain install nightly rustup component add rustfmt --toolchain nightly + - name: Ensure the `main` branch rustfmt is applied for the run + run: git checkout main rustfmt.toml + - name: Run cargo +nightly fmt --check run: cargo +nightly fmt --check