Commit cf79e08

Eric Bower  ·  2026-05-07 16:07:34 -0400 EDT
parent d0a266c
fix(hooks): post-receive workspace
2 files changed,  +4, -2
M hooks/post-receive
+2, -2
 1@@ -19,10 +19,10 @@ while read -r old_sha new_sha ref; do
 2     branch="${ref#refs/heads/}"
 3 
 4     # Repo name from the bare repo directory
 5-    repo="$(basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)" .git)"
 6+    repo="$(basename "$(pwd)" .git)"
 7 
 8     # Workspace is the bare repo itself (runner rsyncs from here)
 9-    workspace="$(git rev-parse --git-dir 2>/dev/null || pwd)"
10+    workspace="$(pwd)"
11 
12     event=$(printf '{"type":"git.push","name":"%s","workspace":"%s","branch":"%s","commit":"%s"}' \
13         "$repo" "$workspace" "$branch" "$new_sha")
M main.go
+2, -0
1@@ -51,6 +51,8 @@ type Event struct {
2 	Type         string `json:"type"`
3 	Name         string `json:"name"`
4 	Workspace    string `json:"workspace"`
5+	Branch       string `json:"branch"`
6+	Commit       string `json:"commit"`
7 	ArtifactDest string `json:"artifact_dest"`
8 	ArtifactURL  string `json:"artifact_url"` // public URL for artifacts (e.g. https://{user}-artifacts.pgs.sh/{repo})
9 }