Skip to content

Commit

Permalink
Unpack / unwrap the pre-commit action, and conditionally rerun dotnet…
Browse files Browse the repository at this point in the history
…-format
  • Loading branch information
mikeage committed May 27, 2024
1 parent 180b625 commit 299048d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 299048d

Please sign in to comment.