Skip to content

Commit 6825c16

Browse files
committed
force git env
1 parent 392f52e commit 6825c16

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/regenerate-all.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ jobs:
5656
echo "Is this a shallow clone?"
5757
[ -f .git/shallow ] && echo "Yes, it is shallow" || echo "No, it is not shallow"
5858
59+
- name: Force Git Environment
60+
run: |
61+
# The runner image likely updated and is now stricter about git state.
62+
# We force a valid git state so that synthtool doesn't panic.
63+
git config --global user.email "ci@example.com"
64+
git config --global user.name "CI Bot"
65+
git config --global init.defaultBranch main
66+
# Ensure current directory is a safe directory for git
67+
git config --global --add safe.directory /home/runner/work/google-cloud-python/google-cloud-python
68+
# Ensure a local branch exists
69+
git checkout -B main
70+
5971
- name: Regenerate
6072
run: |
6173
version=$(sed -n 's/^version: *//p' librarian.yaml)

0 commit comments

Comments
 (0)