Skip to content
Draft

wip #17218

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions .github/workflows/regenerate-all.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Regenerate all packages after merging to main

on:
push:
pull_request:
branches:
- main

Expand All @@ -14,6 +14,7 @@ jobs:
runs-on: ubuntu-latest
env:
PANDOC_VERSION: 3.8.2
CACHE_VERSION: v2

steps:
- name: Checkout
Expand All @@ -27,7 +28,7 @@ jobs:
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
version: "25.3"
version: "33.2"

- name: Install pandoc
run: |
Expand All @@ -39,13 +40,42 @@ jobs:
- name: Install Python packages for Librarian
run: |
version=$(sed -n 's/^version: *//p' librarian.yaml)
go run "github.com/googleapis/librarian/cmd/librarian@${version}" install
go run "github.com/googleapis/librarian/cmd/librarian@v0.13.0" install

- name: Debug Git State
run: |
echo "Current directory: $(pwd)"
echo "Git status:"
git status
echo "Git branch output:"
git branch
echo "HEAD reference:"
git rev-parse HEAD
echo "Current branch:"
git branch --show-current
echo "Is this a shallow clone?"
[ -f .git/shallow ] && echo "Yes, it is shallow" || echo "No, it is not shallow"

- name: Force Git Environment
run: |
# The runner image likely updated and is now stricter about git state.
# We force a valid git state so that synthtool doesn't panic.
git config --global user.email "ci@example.com"
git config --global user.name "CI Bot"
git config --global init.defaultBranch main
# Ensure current directory is a safe directory for git
git config --global --add safe.directory /home/runner/work/google-cloud-python/google-cloud-python
# Ensure a local branch exists
git checkout -B main

- name: Regenerate
run: |
# 1. Clean the cache that synthtool uses
rm -rf $HOME/.cache/synthtool

version=$(sed -n 's/^version: *//p' librarian.yaml)
PATH=$PATH:/tmp/pandoc/bin
go run "github.com/googleapis/librarian/cmd/librarian@${version}" generate -all -v
go run "github.com/googleapis/librarian/cmd/librarian@v0.13.0" generate -all -v

- name: Create issue on diff
env:
Expand Down
Loading