From 3fd063cdd95043143bf0adfa3c1d1f5f171bc250 Mon Sep 17 00:00:00 2001 From: sck_0 Date: Tue, 27 Jan 2026 09:48:00 +0100 Subject: [PATCH] chore: allow CI auto-sync of registry using GITHUB_TOKEN --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 962e8cf4..8a2c6828 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,27 @@ jobs: run: | python3 scripts/update_readme.py + - name: Set up GitHub credentials (for auto-sync) + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git + + - name: Auto-commit registry drift (main only) + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: | + # Se non ci sono cambi, esci senza errore + git diff --quiet && exit 0 + + git add README.md skills_index.json || true + + # Se non c'è niente da committare, esci senza errore + git diff --cached --quiet && exit 0 + + git commit -m "chore: sync generated registry files [ci skip]" + git push origin HEAD + - name: 🚨 Check for Uncommitted Drift run: | if ! git diff --quiet; then