You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix: Update git remote URL with current PAT on agent restart #208
When an agent restarts and its workspace volume already has a .git directory, startup.sh skips cloning and runs git fetch. However, the git remote URL still has the old PAT embedded from the original clone:
# startup.sh line 88 (only runs on first clone)
git remote set-url origin "https://oauth2:${GITHUB_PAT}@github.com/${GITHUB_REPO}.git"
On restart (line 16-27), the remote URL in .git/config is never updated, so git operations use the stale PAT even if the Docker env var has been updated.
Solution
In the "repo already exists" branch of startup.sh (line 16-27), update the remote URL with the current GITHUB_PAT env var before fetching:
if [ -d"/home/developer/.git" ];then# Update remote URL with current PAT (may have changed since last start)if [ -n"${GITHUB_PAT}" ];then
git remote set-url origin "https://oauth2:${GITHUB_PAT}@github.com/${GITHUB_REPO}.git"fi
git fetch origin 2>&1||echo"Note: Could not fetch from remote"fi
Files
docker/base-image/startup.sh (lines 16-27)
Acceptance Criteria
On agent restart, git remote URL is updated with current GITHUB_PAT env var
Git fetch/pull/push operations use the updated PAT
Activity
fix: Update git remote URL with current PAT on agent restart (Ability…