This docker image provides pre-commit with some other potential dependencies pre-installed. It is used in CI environments where we want to have a working install of pre-commit available quickly.
- NodeJS LTS
To test a directory run
docker run --rm -v $(pwd):/test pre-commit
The mounted directory must be a git repository and contain the .git
directory.
pre-commit creates virtual environments for each check. To cache these between builds you should persist the /pre-commit-cache
directory.
pre-commit:
stage: test
image: ghcr.io/wegift/pre-commit:<version>
variables:
PRE_COMMIT_HOME: pre-commit-cache
cache:
- key:
files:
- pre-commit-config.yaml
paths:
- pre-commit-cache
script:
- pre-commit run --all-files --show-diff-on-failure
To make a new release create a tag with the desired version. We do not prefix the version number with v
as this is the standard within the Docker ecosystem.
git tag -am "<description>" X.Y.Z
git push origin X.Y.Z
Then create a release in GitHub for this tag. CI will then run and publish the version to GHCR.