bradnow Claude Sonnet 4.6 commited on
Commit
d6b0a9e
·
1 Parent(s): 1d52448

Add push-staging.sh: push + patch staging Space metadata

Browse files

Keeps README.md prod-canonical in git. After each push to origin,
calls huggingface_hub.metadata_update() to set staging title/color
independently — no more merge conflicts on prod promotion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. scripts/push-staging.sh +26 -0
scripts/push-staging.sh ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Push main to staging HF Space and patch its title/color.
3
+ # README.md stays prod-canonical in git; staging display name set independently.
4
+ set -euo pipefail
5
+
6
+ STAGING_REMOTE="origin"
7
+ STAGING_SPACE="ServiceNow-AI/NowAI-Bench-Staging"
8
+ STAGING_TITLE="NowAI-Bench Staging"
9
+ STAGING_COLOR="indigo"
10
+
11
+ echo "→ Pushing to staging..."
12
+ git push "$STAGING_REMOTE" main
13
+
14
+ echo "→ Patching staging Space metadata..."
15
+ python3 - <<PYEOF
16
+ from huggingface_hub import metadata_update
17
+ url = metadata_update(
18
+ "$STAGING_SPACE",
19
+ {"title": "$STAGING_TITLE", "colorFrom": "$STAGING_COLOR"},
20
+ repo_type="space",
21
+ overwrite=True,
22
+ )
23
+ print(f" committed: {url}")
24
+ PYEOF
25
+
26
+ echo "✓ Staging Space ready: https://huggingface.co/spaces/${STAGING_SPACE}"