Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.

Commit 3ac3313

Browse files
authored
Merge pull request #5 from th30d4y/copilot/fix-auto-increment-issue
fix: fallback increment when GitHub API returns 0 contributors
2 parents e0b143f + f24c050 commit 3ac3313

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/auto-increment-contributors.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,18 @@ jobs:
239239
echo "✅ Loop complete — $ITERATION commits made this run."
240240
echo "Repos used so far: $(wc -l < .used_repos.txt) / $TOTAL_REPOS"
241241
echo "Logins used so far: $(wc -l < .used_logins.txt)"
242+
243+
# ── Fallback: if no commits were made, increment directly ─────────
244+
if [ $ITERATION -eq 0 ]; then
245+
echo "No logins fetched — performing fallback increment..."
246+
git pull origin main --no-edit 2>/dev/null || true
247+
CURRENT=$(grep -oP '(?<=Counter: )\d+' README.md 2>/dev/null || echo "0")
248+
NEW=$(( CURRENT + 2 ))
249+
sed -i "s/Counter: ${CURRENT}/Counter: ${NEW}/" README.md
250+
git config user.name "github-actions[bot]"
251+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
252+
git add README.md
253+
git commit -m "chore: increment counter to $NEW" 2>/dev/null
254+
git push origin main 2>/dev/null
255+
echo "✅ Fallback → counter $CURRENT → $NEW"
256+
fi

0 commit comments

Comments
 (0)