Skip to content

Commit

Permalink
[Enhancement] CI: Run rustfmt when .rustfmt.toml was Edited; Fixes
Browse files Browse the repository at this point in the history
…#38 (#42)

* Added ::= .github/workflows/rustfmt.yml; fixes #38

* Create summary of recent changes

---------

Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
kevinmatthes and github-actions[bot] committed Jan 14, 2024
1 parent 7a4df4c commit 9135be6
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
######################## GNU General Public License 3.0 ########################
## ##
## Copyright (C) 2024 Kevin Matthes ##
## ##
## This program is free software: you can redistribute it and/or modify ##
## it under the terms of the GNU General Public License as published by ##
## the Free Software Foundation, either version 3 of the License, or ##
## (at your option) any later version. ##
## ##
## This program is distributed in the hope that it will be useful, ##
## but WITHOUT ANY WARRANTY; without even the implied warranty of ##
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ##
## GNU General Public License for more details. ##
## ##
## You should have received a copy of the GNU General Public License ##
## along with this program. If not, see <https://www.gnu.org/licenses/>. ##
## ##
################################################################################

################################################################################
##
## AUTHOR Kevin Matthes
## BRIEF Reformat the Rust source code.
## COPYRIGHT GPL-3.0
## DATE 2024
## FILE rustfmt.yml
## NOTE See `LICENSE' for full license.
## See `README.md' for project details.
##
################################################################################

name: rustfmt

on:
push:
branches-ignore:
- main
paths:
- .rustfmt.toml

permissions:
contents: write

jobs:
reformat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
ref: ${{ github.head_ref }}

- uses: fregante/setup-git-user@v2.0.1

- run: |
cargo fmt
git add .
git commit --allow-empty -m '[GitHub Actions] cargo fmt'
git push
################################################################################
8 changes: 8 additions & 0 deletions changelog.d/20240114_151513_GitHub_Actions_38.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(
references: {},
changes: {
"Added": [
".github/workflows/rustfmt.yml; fixes #38",
],
},
)

0 comments on commit 9135be6

Please sign in to comment.