File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Nightly rustfmt
2+
3+ permissions :
4+ contents : write
5+ pull-requests : write
6+
7+ on :
8+ schedule :
9+ - cron : " 0 0 * * 0" # runs weekly on Sunday at 00:00
10+ workflow_dispatch : # allows manual triggering
11+ jobs :
12+ format :
13+ name : Nightly rustfmt
14+ runs-on : ubuntu-24.04
15+ steps :
16+ - uses : actions/checkout@v5
17+ - uses : dtolnay/rust-toolchain@nightly
18+ with :
19+ components : rustfmt
20+ - name : Run Nightly rustfmt
21+ # Run the formatter and manually remove trailing whitespace.
22+ run : cargo +nightly fmt && git ls-files -- '*.rs' -z | xargs sed -E -i'' -e 's/[[:space:]]+$//'
23+ - name : Get the current date
24+ run : echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
25+ - name : Create Pull Request
26+ uses : peter-evans/create-pull-request@v7
27+ with :
28+ author : Fmt Bot <bot@example.com>
29+ title : Automated nightly rustfmt (${{ env.date }})
30+ body : |
31+ Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
32+ commit-message : ${{ env.date }} automated rustfmt nightly
33+ labels : rustfmt
You can’t perform that action at this time.
0 commit comments