NowAI-Bench / scripts /push-staging.sh
bradnow's picture
Update Space colors: prod indigo, staging red
9a74a7d
#!/usr/bin/env bash
# Push main to staging HF Space and patch its title/color.
#
# README.md in git stays prod-canonical (title: NowAI-Bench, colorFrom: indigo).
# After each push, huggingface_hub.metadata_update() commits a README patch
# directly on the staging Space. We force-push on the next run to overwrite it,
# so that commit never needs to be merged locally.
set -euo pipefail
STAGING_REMOTE="origin"
STAGING_SPACE="ServiceNow-AI/NowAI-Bench-Staging"
STAGING_TITLE="NowAI-Bench Staging"
STAGING_COLOR="red"
echo "β†’ Force-pushing to staging (overwrites prior metadata patch)..."
git push --force "$STAGING_REMOTE" main
echo "β†’ Patching staging Space metadata..."
python3 - <<PYEOF
from huggingface_hub import metadata_update
url = metadata_update(
"$STAGING_SPACE",
{"title": "$STAGING_TITLE", "colorFrom": "$STAGING_COLOR"},
repo_type="space",
overwrite=True,
)
print(f" committed: {url}")
PYEOF
echo "βœ“ Staging Space ready: https://huggingface.co/spaces/${STAGING_SPACE}"
echo " (staging remote is now 1 commit ahead β€” that's expected)"