From b21c5fb093b4741e90562b4f8e5f96862c1bca46 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Tue, 7 Apr 2026 08:13:23 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=20fix:=20prevent=20CI=20loops=20an?= =?UTF-8?q?d=20add=20proper=20git=20authentication?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci-cd.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index 6d48bf4..596e24f 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -54,6 +54,7 @@ jobs: ci-pipeline: name: CI Pipeline runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[skip ci]') && github.actor != 'ci-bot'" steps: - name: Checkout code @@ -101,11 +102,16 @@ jobs: BADGE_URL="https://img.shields.io/badge/coverage-${COVERAGE}%-${COLOR}?style=flat-square" sed -i "s|https://img.shields.io/badge/coverage-.*-.*?style=flat-square|${BADGE_URL}|" README.md - # Commit and push the update + # Set up git authentication and commit git config --global user.name "CI Bot" git config --global user.email "ci@arcodange.fr" + + # Set up credentials using Gitea token + git config --global credential.helper store + echo "https://${{ secrets.PACKAGES_TOKEN }}@gitea.arcodange.lab" > ~/.git-credentials + git add README.md - git commit -m "🤖 chore: update coverage badge to ${COVERAGE}%" || echo "No coverage change to commit" + git commit -m "🤖 chore: update coverage badge to ${COVERAGE}% [skip ci]" || echo "No coverage change to commit" git push || echo "Push failed - may be duplicate commit" - name: Run go fmt