Skip to content

chore: decompose cargo-hack feature sweep into per-crate parallel targets #797

chore: decompose cargo-hack feature sweep into per-crate parallel targets

chore: decompose cargo-hack feature sweep into per-crate parallel targets #797

Workflow file for this run

name: Auto-fix
on:
pull_request:
types: [opened, synchronize]
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
autofix:
name: Auto-fix formatting
runs-on: ubuntu-latest
# Don't run on forks (they can't push back) or dependabot PRs
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # ratchet:actions/checkout@v6.0.3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # ratchet:bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Run rustfmt
run: bazelisk run @rules_rust//:rustfmt
- name: Run Prettier
run: bazelisk run //:prettier_fix
- name: Run ruff
run: bazelisk run //:ruff_fix
- name: Regenerate docs
run: bazelisk run //:codegen_docs_fix
- name: Check for changes
id: changes
run: |
if git diff --quiet; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push fixes
if: steps.changes.outputs.has_changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "chore: auto-fix formatting"
git push