Fix Gitea push URL token injection for HTTPS
This commit is contained in:
@@ -100,7 +100,14 @@ git config user.name "AppFactory Bot"
|
||||
git config user.email "appfactory@local"
|
||||
git branch -M main
|
||||
|
||||
GITEA_PUSH_URL="${GITEA_URL/http:\/\//http:\/\/${GITEA_TOKEN}@}"
|
||||
if [[ "$GITEA_URL" == http://* ]]; then
|
||||
GITEA_PUSH_URL="${GITEA_URL/http:\/\//http:\/\/${GITEA_TOKEN}@}"
|
||||
elif [[ "$GITEA_URL" == https://* ]]; then
|
||||
GITEA_PUSH_URL="${GITEA_URL/https:\/\//https:\/\/${GITEA_TOKEN}@}"
|
||||
else
|
||||
echo "Unsupported GITEA_URL: $GITEA_URL"
|
||||
exit 1
|
||||
fi
|
||||
git remote add origin "$GITEA_PUSH_URL/$GITEA_ORG/$APP_ID.git"
|
||||
|
||||
git add .
|
||||
|
||||
Reference in New Issue
Block a user