-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (25 loc) · 788 Bytes
/
fmt.yml
File metadata and controls
34 lines (25 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Formatting
on:
workflow_dispatch:
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.PUBLISH_TOKEN }}
ref: ${{ github.ref_name }}
- name: Run cargo fmt
run: cargo fmt --all
- name: Check for changes
id: git-diff
run: |
git diff --quiet || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit and push changes
if: steps.git-diff.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -am "fix: apply rustfmt"
git push origin ${{ github.ref_name }}