forked from icosa-foundation/open-brush
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unpack / unwrap the pre-commit action, and conditionally rerun dotnet…
…-format
- Loading branch information
Showing
1 changed file
with
18 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,21 @@ jobs: | |
- uses: actions/[email protected] | ||
with: | ||
dotnet-version: '8.0.x' | ||
- uses: pre-commit/[email protected] | ||
- name: Install pre-commit | ||
run: python -m pip install pre-commit | ||
shell: bash | ||
- name: Cache pre-commit environments | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Setup pre-commit environments | ||
run: pre-commit run | ||
- name: Run pre-commit dotnet-format, with retries | ||
uses: Wandalen/wretry.action@v3 | ||
with: | ||
command: pre-commit run dotnet-format --show-diff-on-failure --color=always --all-files | ||
- name: Remove dotnet-format from the list of pre-commit jobs to run (since we already ran it) | ||
run: yq eval 'del(.repos[] | select(.hooks[].id == "dotnet-format"))' -i .pre-commit-config.yaml | ||
- name: Run the rest of pre-commit | ||
run: pre-commit run --show-diff-on-failure --color=always --all-files |