I'm using a custom pre-commit hook that's in a private repo.
- repo: git@github.com:username/precommit-hooks.git
rev: v0.0.1
hooks:
- id: check-security
I run it in a github action
- name: Run pre-commit on changed files
run: |
pip install pre-commit
pre-commit run --from-ref origin/HEAD --to-ref HEAD
But it errors for credential failure, but shouldn't checkout persist-credentials
?
The auth token is persisted in the local git config. This enables your scripts to run authenticated git commands. The token is removed during post-job cleanup. Set persist-credentials: false to opt-out.
[INFO] Initializing environment for git@github.com:homer/precommit-hooks.git.
An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/git', 'fetch', 'origin', '--tags')
return code: 128
stdout: (none)
stderr:
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
What's a good way to configure SSH creds?