Skip to content

Commit 93edf83

Browse files
authored
ci(deploy): install SKILLS_GITHUB_TOKEN as GITHUB_TOKEN in the backend .env (#160)
The gateway's SKILL.md backfill (skill_content.py) calls the GitHub API unauthenticated from one EC2 IP — 60 req/hr shared across every user. Write the SKILLS_GITHUB_TOKEN secret into the host .env on deploy (replace-on- deploy, so rotating the secret rotates the host; skipped when unset). The Convex-side skill imports get the same token via the Convex env directly. (cherry picked from commit b6b74a5)
1 parent 581afce commit 93edf83

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/backend-cd.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ jobs:
8080
# REDIS_URL just disables live-following fan-out.
8181
grep -q '^REDIS_URL=' .env 2>/dev/null || \
8282
echo 'REDIS_URL=redis://127.0.0.1:6379/${{ steps.env.outputs.redis_db }}' >> .env
83+
# GitHub token for the gateway's SKILL.md backfill (raises the API
84+
# rate limit from 60/hr/IP to 5000/hr). Replace-on-deploy so
85+
# rotating the SKILLS_GITHUB_TOKEN secret rotates the host.
86+
if [ -n '${{ secrets.SKILLS_GITHUB_TOKEN }}' ]; then
87+
sed -i '/^GITHUB_TOKEN=/d' .env 2>/dev/null || true
88+
echo 'GITHUB_TOKEN=${{ secrets.SKILLS_GITHUB_TOKEN }}' >> .env
89+
fi
8390
python3.11 -m venv .venv 2>/dev/null || true
8491
.venv/bin/pip install -q -r requirements.txt
8592
sudo systemctl restart ${{ steps.env.outputs.service }}

0 commit comments

Comments
 (0)