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 | |
| 19 | 19 | branch="${ref#refs/heads/}" | |
| 20 | 20 | ||
| 21 | 21 | # 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)" | |
| 23 | 23 | ||
| 24 | 24 | # Workspace is the bare repo itself (runner rsyncs from here) | |
| 25 | - | workspace="$(git rev-parse --git-dir 2>/dev/null || pwd)" | |
| 25 | + | workspace="$(pwd)" | |
| 26 | 26 | ||
| 27 | 27 | event=$(printf '{"type":"git.push","name":"%s","workspace":"%s","branch":"%s","commit":"%s"}' \ | |
| 28 | 28 | "$repo" "$workspace" "$branch" "$new_sha") |
M
main.go
+2,
-0
| ... | ... | @@ -51,6 +51,8 @@ type Event struct { | |
| 51 | 51 | Type string `json:"type"` | |
| 52 | 52 | Name string `json:"name"` | |
| 53 | 53 | Workspace string `json:"workspace"` | |
| 54 | + | Branch string `json:"branch"` | |
| 55 | + | Commit string `json:"commit"` | |
| 54 | 56 | ArtifactDest string `json:"artifact_dest"` | |
| 55 | 57 | ArtifactURL string `json:"artifact_url"` // public URL for artifacts (e.g. https://{user}-artifacts.pgs.sh/{repo}) | |
| 56 | 58 | } |