5
0
Fork 0
mirror of https://github.com/pre-commit/action.git synced 2025-11-12 21:13:45 +00:00
pre-commit-action/action.yml
Edgar Ramírez-Mondragón 89e11bc533
Pin actions/cache
GitHub recently added support for requiring actions to be pinned to a
full-length commit SHA[^1].

Their changelog doesn't mention that composite actions also fail if
their own actions are not pinned, which is the case for this project.

Hope this makes sense. I didn't bump the versions, just added the commit
SHAs, using `pinact run`.

[^1]: https://github.blog/changelog/2025-08-15-github-actions-policy-now-supports-blocking-and-sha-pinning-actions/
2025-09-03 22:41:01 -06:00

20 lines
624 B
YAML

name: pre-commit
description: run pre-commit
inputs:
extra_args:
description: options to pass to pre-commit run
required: false
default: '--all-files'
runs:
using: composite
steps:
- run: python -m pip install pre-commit
shell: bash
- run: python -m pip freeze --local
shell: bash
- uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: pre-commit run --show-diff-on-failure --color=always ${{ inputs.extra_args }}
shell: bash