From bd49fe17d10cef1cad7c530ece9ec61b61b6bc97 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sat, 7 Jun 2025 19:21:32 +0200 Subject: [PATCH] ci fix --- .gitea/workflows/ci.yml | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index b277838..fb3c712 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -161,36 +161,19 @@ jobs: # Set the remote URL to use the token git remote set-url origin https://${{ secrets.PUSH_TOKEN }}@gitea.tourolle.paris/dtourolle/pyWebLayout.git - # Stash any local changes to avoid conflicts - git stash push -u -m "Temporary stash before badges branch" + # Create a new orphan branch for badges (this discards any existing badges branch) + git checkout --orphan badges - # 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 - - # 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 + # Remove all files except cov_info find . -maxdepth 1 -not -name '.git' -not -name 'cov_info' -exec rm -rf {} + 2>/dev/null || true - # Add the coverage info directory + # Add only the coverage info directory git add -f cov_info/ - if git diff --staged --quiet; then - echo "No badge changes to commit" - else - echo "Committing updated badges to badges branch..." - git commit -m "Update coverage badges [skip ci]" - git push origin badges - fi + # Always commit (force overwrite) + echo "Force updating badges branch with new coverage data..." + git commit -m "Update coverage badges [skip ci]" + git push -f origin badges - name: Test package installation run: |