From f24c050f9830bc3d6a5682bd3695f7d2bc570864 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 3 May 2026 06:48:08 +0000 Subject: [PATCH] fix: add fallback increment when GitHub API returns 0 contributors Agent-Logs-Url: https://github.com/th30d4y/0Commits/sessions/4635326d-50d1-44c6-93a1-c300a52c1314 Co-authored-by: 0x5t4l1n <161853795+0x5t4l1n@users.noreply.github.com> --- .github/workflows/auto-increment-contributors.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/auto-increment-contributors.yml b/.github/workflows/auto-increment-contributors.yml index 6089fb8..8cec8c0 100644 --- a/.github/workflows/auto-increment-contributors.yml +++ b/.github/workflows/auto-increment-contributors.yml @@ -239,3 +239,18 @@ jobs: echo "✅ Loop complete — $ITERATION commits made this run." echo "Repos used so far: $(wc -l < .used_repos.txt) / $TOTAL_REPOS" echo "Logins used so far: $(wc -l < .used_logins.txt)" + + # ── Fallback: if no commits were made, increment directly ───────── + if [ $ITERATION -eq 0 ]; then + echo "No logins fetched — performing fallback increment..." + git pull origin main --no-edit 2>/dev/null || true + CURRENT=$(grep -oP '(?<=Counter: )\d+' README.md 2>/dev/null || echo "0") + NEW=$(( CURRENT + 2 )) + sed -i "s/Counter: ${CURRENT}/Counter: ${NEW}/" README.md + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add README.md + git commit -m "chore: increment counter to $NEW" 2>/dev/null + git push origin main 2>/dev/null + echo "✅ Fallback → counter $CURRENT → $NEW" + fi