Daily code format check #181
This file contains hidden or 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: Daily code format check | |
| on: | |
| schedule: | |
| - cron: 0 0 * * * # Every day at midnight (UTC) | |
| workflow_dispatch: | |
| jobs: | |
| dotnet-format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: global.json | |
| - name: Install XamlStyler.Console | |
| run: dotnet tool install --global XamlStyler.Console | |
| - name: Run dotnet format | |
| run: dotnet format Beutl.slnx --verbosity diagnostic | |
| # Avaloniaのxamlで Panel > TextBlock のような時に > が > に変換されてしまうので一旦無効化 | |
| # - name: Run xaml styler | |
| # run: xstyler -f ./**/*.axaml --ignore -c xamlstyler.json | |
| - name: Check for modified files | |
| id: git-check | |
| run: echo "::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" | |
| - name: Commit files | |
| if: steps.git-check.outputs.modified == 'true' | |
| run: | | |
| git config --local user.name "github-actions[bot]" | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git commit -a -m 'Automated dotnet-format update' | |
| - name: Create Pull Request | |
| if: steps.git-check.outputs.modified == 'true' | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| title: 'chore: Automated PR to fix formatting errors' | |
| body: | | |
| Automated PR to fix formatting errors | |
| committer: GitHub <[email protected]> | |
| author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
| labels: housekeeping | |
| assignees: yuto-trd | |
| reviewers: yuto-trd | |
| branch: chore/fix-codeformatting |