Skip to content

publish: lcode: 0.9.4, lcode-config: 0.3.15, leetcode-api: 0.4.2 #186

publish: lcode: 0.9.4, lcode-config: 0.3.15, leetcode-api: 0.4.2

publish: lcode: 0.9.4, lcode-config: 0.3.15, leetcode-api: 0.4.2 #186

Workflow file for this run

name: Rustfmt
on: [push, pull_request, merge_group]
permissions:
contents: write
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout/@v4
- uses: dtolnay/rust-toolchain@master
with:
# my rustfmt config use many nightly features
toolchain: nightly
components: rustfmt, cargo
- name: Run fmt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_MSG: |
fmt: with nightly rustfmt
run: |
cargo +nightly fmt --all
git config user.email "actions@github"
git config user.name "Github Actions"
git remote set-url origin https://x-access-token:"${GITHUB_TOKEN}"@github.com/"${GITHUB_REPOSITORY}".git
git add crates/
# shellcheck disable=SC2015
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:"${GITHUB_REF}")