From a7d10aae6da088197327c9a4b38b68a6238bb993 Mon Sep 17 00:00:00 2001 From: Wes Tarle Date: Mon, 17 Aug 2026 17:10:51 +0000 Subject: [PATCH] fix: librarian checks should indicate steps to repair Fixes: 9148 --- .github/workflows/generation_check.yaml | 7 ++++++- .github/workflows/librarian_tidy.yml | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generation_check.yaml b/.github/workflows/generation_check.yaml index 4e8c12451f2f..2b56938a27c5 100644 --- a/.github/workflows/generation_check.yaml +++ b/.github/workflows/generation_check.yaml @@ -59,7 +59,12 @@ jobs: echo "==================== GIT DIFF ====================" git diff echo "==================================================" - echo "Regeneration failed. Please run 'librarian generate --all' to update the generated files." + V=$(sed -n 's/^version: //p' librarian.yaml) + echo "Regeneration failed. Please run:" + echo "" + echo " go run github.com/googleapis/librarian/cmd/librarian@$V generate --all" + echo "" + echo "to update the generated files." exit 1 fi - name: Create issue if previous step fails diff --git a/.github/workflows/librarian_tidy.yml b/.github/workflows/librarian_tidy.yml index e830d1d3f187..70a1f21f894b 100644 --- a/.github/workflows/librarian_tidy.yml +++ b/.github/workflows/librarian_tidy.yml @@ -37,10 +37,10 @@ jobs: if: steps.changes.outputs.librarian == 'true' run: | if ! git diff --exit-code; then - V=$(librarian config get version 2>/dev/null || echo "latest") + V=$(sed -n 's/^version: //p' librarian.yaml) echo "librarian.yaml is not tidy. Please run:" echo "" - echo " librarian tidy" + echo " go run github.com/googleapis/librarian/cmd/librarian@$V tidy" echo "" echo "to tidy librarian.yaml and commit the changes." exit 1