Skip to content

Commit ca9c71e

Browse files
authored
fix: configure git identity in cleanup workflow (#97)
## Summary - The `clean_docs_branch` job fails with `fatal: empty ident name` because no git `user.name`/`user.email` is configured on the runner - Also adds a guard for the "nothing to commit" case (when ≤25 PR dirs exist) Same fix as n0-computer/iroh#3920
1 parent 0af8f5c commit ca9c71e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/workflows/cleanup.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
ref: generated-docs-preview
2929
- name: Clean docs branch
3030
run: |
31+
git config user.name "github-actions[bot]"
32+
git config user.email "github-actions[bot]@users.noreply.github.com"
3133
cd pr/
3234
# keep the last 25 prs
3335
dirs=$(ls -1d [0-9]* | sort -n)
@@ -37,5 +39,6 @@ jobs:
3739
echo "$dirs_to_remove" | xargs rm -rf
3840
fi
3941
git add .
42+
git diff --cached --quiet && echo "Nothing to clean up" && exit 0
4043
git commit -m "Cleanup old docs"
4144
git push

0 commit comments

Comments
 (0)