File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Manual Auto Format and Build
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ branch :
7+ description : ' Branch to run on'
8+ required : true
9+ default : ${{ github.ref_name }}
10+
11+ jobs :
12+ format-and-build :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - uses : actions/checkout@v4
17+ with :
18+ token : ${{ secrets.GITHUB_TOKEN }}
19+ ref : ${{ github.event.inputs.branch }}
20+
21+ - name : Install Rust
22+ uses : actions-rs/toolchain@v1
23+ with :
24+ toolchain : stable
25+ components : rustfmt
26+
27+ - name : Run cargo fmt
28+ run : cargo fmt --all
29+
30+ - name : Run cargo build
31+ run : cargo build --verbose
32+
33+ - name : Commit and Push Formatted Changes
34+ if : success()
35+ run : |
36+ if [ -n "$(git status --porcelain)" ]; then
37+ git config user.name 'github-actions[bot]'
38+ git config user.email 'github-actions[bot]@users.noreply.github.com'
39+ git add .
40+ git commit -m "fmt"
41+ git push origin ${{ github.event.inputs.branch }}
42+ fi
You can’t perform that action at this time.
0 commit comments