Merge pull request #380 from commjoen/dependabot/npm_and_yarn/cssstyl… #644
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: Pre-commit | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| - name: Install Node.js dependencies | |
| run: npm ci | |
| - name: Cache pre-commit environments | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
| restore-keys: | | |
| pre-commit- | |
| - name: Install pre-commit | |
| run: pip install pre-commit | |
| - name: Run pre-commit on all files (main branch) | |
| if: github.ref == 'refs/heads/main' | |
| run: pre-commit run --all-files | |
| - name: Run pre-commit on changed files (PRs) | |
| if: github.event_name == 'pull_request' | |
| run: pre-commit run --from-ref ${{ github.event.pull_request.base.sha }} --to-ref HEAD |