From 96a74dbad10e4a40371deedb6bf23226fcb8408b Mon Sep 17 00:00:00 2001 From: Juan Sebastian Montoya Date: Wed, 26 Nov 2025 12:52:33 -0500 Subject: [PATCH] Refactor CI workflow to simplify remote URL configuration - Removed complex remote URL configuration logic for authentication. - Updated comments to clarify that the remote should already be configured with the token before pushing to the main branch. --- .forgejo/workflows/ci.yaml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index 05d4970..811ad63 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -187,20 +187,6 @@ jobs: git config user.name "forgebot" git config user.email "forgebot@forgejo.io" - # Configure remote URL with token for authentication - # Extract repository URL and add token - REPO_URL=$(git remote get-url origin) - # Handle both https and git@ formats - if [[ "$REPO_URL" == https://* ]]; then - # Extract domain and path from https URL - REPO_PATH=$(echo "$REPO_URL" | sed 's|https://||' | sed 's|git@||' | sed 's|:|/|') - git remote set-url origin "https://${{ secrets.FORGEBOT_ACCESS_TOKEN }}@${REPO_PATH}" - else - # For git@ format, convert to https with token - REPO_PATH=$(echo "$REPO_URL" | sed 's|git@||' | sed 's|:|/|') - git remote set-url origin "https://${{ secrets.FORGEBOT_ACCESS_TOKEN }}@${REPO_PATH}" - fi - # Fetch latest changes to avoid conflicts git fetch origin main || echo "Fetch completed or already up to date" git checkout main || echo "Already on main" @@ -231,7 +217,7 @@ jobs: exit 0 } - # Push to main branch using the token + # Push to main branch (remote should already be configured with token) git push origin main || { echo "⚠️ Push failed (check token permissions)" exit 0 -- 2.49.1