sqlx prepare #79
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rustfmt | |
# Runs `cargo fmt` whenever code is pushed or pr'd into master. | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
types: | |
- closed | |
jobs: | |
format: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt | |
- run: rustup component add rustfmt | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all | |
- name: Commit files # only runs if something actually changed | |
run: | | |
if [[ -n "$(git status -s)" ]]; then | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -m "CI: Automatic Rustfmt" -a | |
fi | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |