From b5258f5d465d789bd53e6cda494234ce20f4ec5f Mon Sep 17 00:00:00 2001 From: localai-org-maint-bot Date: Tue, 18 Aug 2026 08:54:30 +0200 Subject: [PATCH] fix(ci): refresh site counters through a PR (#11572) Branch protection rejects the weekly workflow's direct push to master. Reuse the repository's create-pull-request automation so counter updates go through the protected-branch review and CI path. Assisted-by: Codex:gpt-5 [actionlint] Co-authored-by: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com> --- .github/workflows/refresh-site-counters.yml | 29 ++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/refresh-site-counters.yml b/.github/workflows/refresh-site-counters.yml index 54acc447c..2af8cf9d2 100644 --- a/.github/workflows/refresh-site-counters.yml +++ b/.github/workflows/refresh-site-counters.yml @@ -14,6 +14,7 @@ on: permissions: contents: write + pull-requests: write concurrency: group: refresh-site-counters @@ -30,15 +31,25 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./.github/ci/refresh-site-counters.sh - - name: Commit only if something moved + - name: Show changes run: | if git diff --quiet -- website/data/stats.yaml; then - echo "counters unchanged, nothing to commit" - exit 0 + echo "counters unchanged" + else + git diff --unified=0 -- website/data/stats.yaml fi - git diff --unified=0 -- website/data/stats.yaml - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add website/data/stats.yaml - git commit -m "chore(website): refresh the counters" - git push + + - name: Create pull request when counters moved + uses: peter-evans/create-pull-request@v8 + with: + token: ${{ secrets.UPDATE_BOT_TOKEN }} + push-to-fork: ci-forks/LocalAI + commit-message: "chore(website): refresh the counters" + title: "chore(website): refresh the counters" + body: | + Weekly refresh of the landing-page counters from the GitHub API. + + This PR was created automatically by the `refresh-site-counters` workflow. + branch: update/site-counters + delete-branch: true + labels: automated