chore: add git post-receive hook
+ 61
- 2
app/components/DrawerPrimary.tsx
@@ -329,7 +329,7 @@ const StyledDrawerPrimary = styled.aside<
     align-items: center;
     justify-content: center;
 
-    position: fixed;
+    position: sticky;
     top: 0;
     left: 0;
     bottom: 0;

app/components/DrawerSettings.tsx
@@ -200,7 +200,7 @@ const StyledDrawerSettings = styled.aside<
     align-items: center;
     justify-content: center;
 
-    position: fixed;
+    position: sticky;
     top: 0;
     left: 0;
     bottom: 0;

new file
scripts/git-hooks/hooks/post-receive
@@ -0,0 +1,59 @@
+#!/bin/bash
+set -euo pipefail
+
+GIT_DIR="$(git rev-parse --git-dir 2>/dev/null || echo .)"
+
+# try to get pusher info from environment (SSH/HTTP vary)
+PUSHER="${GIT_AUTHOR_NAME:-${USER:-unknown}}"
+PUSHER_EMAIL="${GIT_AUTHOR_EMAIL:-}"
+
+timestamp() { date -u +"%Y-%m-%dT%H:%M:%SZ"; }
+
+while read -r old new ref; do
+  # determine ref type
+  if [[ "$ref" == refs/heads/* ]]; then
+    ref_type="branch"
+    ref_name="${ref#refs/heads/}"
+  elif [[ "$ref" == refs/tags/* ]]; then
+    ref_type="tag"
+    ref_name="${ref#refs/tags/}"
+  else
+    ref_type="other"
+    ref_name="$ref"
+  fi
+
+  # commit info (may be empty on deletes where new == 0000000...)
+  if [[ "$new" =~ ^0+$ ]]; then
+    commit_sha=""
+  else
+    commit_sha="$new"
+  fi
+
+  # collect more details where available
+  repo_path="$(pwd)"
+  repo_name="$(basename "$repo_path" .git)"
+  org_name="$(basename "$(dirname "$repo_path")")"
+  pusher_ip="${SSH_CONNECTION%% *}" || pusher_ip=""
+
+  payload_args=(
+    "--repo" "$org_name/$repo_name"
+    "--ref" "$ref"
+    "--ref-type" "$ref_type"
+    "--ref-name" "$ref_name"
+    "--old" "$old"
+    "--new" "$new"
+    "--commit" "$commit_sha"
+    "--pusher" "$PUSHER"
+    "--pusher-email" "$PUSHER_EMAIL"
+    "--pusher-ip" "$pusher_ip"
+    "--git-dir" "$GIT_DIR"
+    "--timestamp" "$(timestamp)"
+  )
+
+  # call asynchronously so push isn't blocked
+  echo "gitfoss-ci-runner trigger \"${payload_args[@]}\"\n"
+  echo "gitfoss-ci-runner trigger \"${payload_args[@]}\"\n" >> /var/log/gitfoss/ci.log
+  /usr/bin/gitfoss-ci-runner trigger "${payload_args[@]}";
+done
+
+exit 0