-
Notifications
You must be signed in to change notification settings - Fork 94
ci: add workflow to format whitespaces #236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ca7fc12
ci: add workflow to format whitespaces
winstxnhdw 3ef7138
ci: only run workflow on PRs
winstxnhdw c07dd30
ci: separate tool restoration step
winstxnhdw ef5d0c1
ci: remove unnecessary quotes
octocat fcea0f8
ci: cache dotnet tools to reduce workflow runtime
winstxnhdw c33b098
ci: remove `push` trigger
winstxnhdw beed770
chore: remove newline
winstxnhdw 50fd5a5
ci: bump `actions/checkout` to `v4`
winstxnhdw 1b4aa1f
ci: use `pull_request_target` to gain write access in forks
winstxnhdw 1a74bbf
Bump actions/checkout from 3 to 4 (#239)
dependabot[bot] 8f76c32
refactor: reuse already implemented methods in Namespaces (#238)
winstxnhdw 8c91d55
fix: write correct value for KV.Release (#237)
winstxnhdw 40d4eae
Merge branch 'master' into formatter
winstxnhdw 38a1865
ci: use `push` trigger instead
winstxnhdw 2051252
ci: only run workflow if it is a fork
winstxnhdw d10e93f
Merge branch 'master' into formatter
winstxnhdw 82a704f
ci/fix: use `pull_request_target` again
winstxnhdw f1d0c12
Merge branch 'master' into formatter
winstxnhdw 632cd44
Merge branch 'master' into formatter
marcin-krystianc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: Format | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: ['**.cs'] | ||
| push: | ||
| branches-ignore: [master] | ||
winstxnhdw marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| paths: | ||
| - '**.editorconfig' | ||
| - '**.globalconfig' | ||
| - '**.cs' | ||
| - .github/workflows/formatter.yml | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| format: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.ref }} | ||
|
|
||
| - name: Cache .NET tools | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: ~/.nuget/packages | ||
| key: dotnet-tools-${{ runner.os }}-${{ hashFiles('.config/dotnet-tools.json') }} | ||
| restore-keys: dotnet-tools-${{ runner.os }}- | ||
|
|
||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v3 | ||
| with: | ||
| dotnet-version: 7.0.x | ||
|
|
||
| - name: Restore tools | ||
| run: dotnet tool restore | ||
|
|
||
| - name: Format scripts | ||
| run: dotnet tool run dotnet-format --fix-whitespace --no-restore | ||
|
|
||
| - name: Set Git config | ||
| run: | | ||
| git config user.name octocat | ||
| git config user.email [email protected] | ||
|
|
||
| - name: Commit changes | ||
| run: | | ||
| git add . | ||
| git commit -m "style: fix whitespaces" || true | ||
| git push | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.