Summary
Hi there 👋
I am trying to make use of uv to run a CLI tool within a git post-receive hook. The CLI tool is hosted in a private github repo. I did some searching through the existing issues and found an issue which looks similar but was closed due to inactivity.
My post-receive hook looks like this.
#!/usr/bin/env bash
while read oldrev newrev ref; do
if [[ $ref =~ .*/main$ ]];
then
pusher=$(git config --get remote.pushuser)
pusher=${pusher:-$USER}
uv tool run \
--verbose \
--from bou@git+ssh://git@github.com/BradleyKirton/bou.git@main \
bou \
build $ref $pusher
else
echo "Ref $ref successfully received."
fi
done
When the hook runs I get the following error.
remote: × Failed to download and build `bou @
remote: │ git+ssh://git@github.com/BradleyKirton/bou.git@main`
remote: ├─▶ Git operation failed
remote: ╰─▶ process didn't exit successfully: `/usr/lib/git-core/git rev-parse`
remote: (exit status: 128)
remote: --- stderr
remote: fatal: not a git repository: '.'
If I manually run the hook it works.
echo "sha sha refs/heads/main" | example/repo/hooks/post-receive
Platform
Linux 6.16.8-arch3-1 x86_64 GNU/Linux
Version
uv 0.8.22
Python version
Python 3.13.6
Summary
Hi there 👋
I am trying to make use of uv to run a CLI tool within a git post-receive hook. The CLI tool is hosted in a private github repo. I did some searching through the existing issues and found an issue which looks similar but was closed due to inactivity.
My post-receive hook looks like this.
When the hook runs I get the following error.
If I manually run the hook it works.
echo "sha sha refs/heads/main" | example/repo/hooks/post-receivePlatform
Linux 6.16.8-arch3-1 x86_64 GNU/Linux
Version
uv 0.8.22
Python version
Python 3.13.6