Commit cf79e08

Eric Bower  ·  2026-05-07 16:07:34 -0400 EDT
parent d0a266c
fix(hooks): post-receive workspace
2 files changed,  +4, -2
+2, -2
......@@ -19,10 +19,10 @@ while read -r old_sha new_sha ref; do
1919 branch="${ref#refs/heads/}"
2020
2121 # Repo name from the bare repo directory
22- repo="$(basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)" .git)"
22+ repo="$(basename "$(pwd)" .git)"
2323
2424 # Workspace is the bare repo itself (runner rsyncs from here)
25- workspace="$(git rev-parse --git-dir 2>/dev/null || pwd)"
25+ workspace="$(pwd)"
2626
2727 event=$(printf '{"type":"git.push","name":"%s","workspace":"%s","branch":"%s","commit":"%s"}' \
2828 "$repo" "$workspace" "$branch" "$new_sha")
+2, -0
......@@ -51,6 +51,8 @@ type Event struct {
5151 Type string `json:"type"`
5252 Name string `json:"name"`
5353 Workspace string `json:"workspace"`
54+ Branch string `json:"branch"`
55+ Commit string `json:"commit"`
5456 ArtifactDest string `json:"artifact_dest"`
5557 ArtifactURL string `json:"artifact_url"` // public URL for artifacts (e.g. https://{user}-artifacts.pgs.sh/{repo})
5658 }