We are using the git-commit
Codefresh step to push updates during a build. We use husky and have pre-commit hooks that rely on yarn
. This fails within the step because the dependency is missing.
How should we handle these hooks?
Here is the current step configuration:
push_snapshots:
stage: deploy
title: Commit and push snapshot updates.
type: git-commit
working_directory: ${{clone}}
arguments:
repo: "${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}"
git: github
commit_message: Update snapshot post infra deploy
add:
- "./tenants/*/snapshot/*"
when:
steps:
- name: deploy_infra
on:
- success
and our .husky/pre-commit
looks like:
yarn lint-staged
We've tried a couple of things:
- Looked for a way to pass the
--no-verify
flag, but it looks like the only flag supported in the step is--allow-empty
, and there is no way to pass arbitrary flags - Tried to override the image with a custom image (that extends
git-commit:1.0
and then adds npm and yarn). That image was not actually read by the step, the step just used its usual image.