fix: run git reset commands as agent user to avoid safe.directory errors (#336)
This commit is contained in:
parent
dc4ed90b56
commit
27f9da57d3
1 changed files with 6 additions and 4 deletions
|
|
@ -29,10 +29,12 @@ if [ ! -d "${PROJECT_REPO_ROOT}/.git" ]; then
|
|||
fi
|
||||
|
||||
# Reset base repo to origin/main to avoid divergence warnings
|
||||
cd "$PROJECT_REPO_ROOT"
|
||||
git fetch origin main
|
||||
git checkout main 2>/dev/null || true
|
||||
git reset --hard origin/main
|
||||
su -s /bin/bash agent -c "
|
||||
cd '/home/agent/repos/disinto'
|
||||
git fetch origin main
|
||||
git checkout main 2>/dev/null || true
|
||||
git reset --hard origin/main
|
||||
"
|
||||
log "Base repo reset to origin/main"
|
||||
|
||||
log "Entering poll loop (interval: ${POLL_INTERVAL:-300}s)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue