From 77b98e352e36fb248cfdd961ff478f2a4c62af7c Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sat, 7 Jun 2025 19:19:12 +0200 Subject: [PATCH] ci fix --- .gitea/workflows/ci.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index fc96ea5..b277838 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -161,14 +161,25 @@ jobs: # Set the remote URL to use the token git remote set-url origin https://${{ secrets.PUSH_TOKEN }}@gitea.tourolle.paris/dtourolle/pyWebLayout.git - # Create or switch to badges branch - git fetch origin badges:badges 2>/dev/null || git checkout --orphan badges - if git show-ref --verify --quiet refs/heads/badges; then - git checkout badges + # Stash any local changes to avoid conflicts + git stash push -u -m "Temporary stash before badges branch" + + # Fetch and checkout badges branch, or create it if it doesn't exist + if git ls-remote --exit-code --heads origin badges >/dev/null 2>&1; then + echo "Badges branch exists, checking it out..." + git fetch origin badges + git checkout -B badges origin/badges + else + echo "Creating new badges branch..." + git checkout --orphan badges + git rm -rf . 2>/dev/null || true fi - # Remove all files except cov_info - git rm -rf . 2>/dev/null || true + # Restore stashed cov_info directory + git stash pop --index 2>/dev/null || echo "No stash to restore" + + # Clean up any existing files and add only cov_info + find . -maxdepth 1 -not -name '.git' -not -name 'cov_info' -exec rm -rf {} + 2>/dev/null || true # Add the coverage info directory git add -f cov_info/