From a5bcfeab54f368415a1305288d24e884c7808a6e Mon Sep 17 00:00:00 2001 From: Noah Dietz Date: Fri, 22 May 2026 18:43:56 +0000 Subject: [PATCH 1/3] chore(ci): add librarian tidy check --- .github/workflows/librarian_tidy.yml | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/librarian_tidy.yml diff --git a/.github/workflows/librarian_tidy.yml b/.github/workflows/librarian_tidy.yml new file mode 100644 index 000000000000..f368302b6820 --- /dev/null +++ b/.github/workflows/librarian_tidy.yml @@ -0,0 +1,51 @@ +name: Check that librarian.yaml is tidy + +on: + pull_request: + paths: + - 'librarian.yaml' + +permissions: + contents: read + +jobs: + tidy-check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: '1.26.x' + + - name: Run librarian tidy + run: | + # go run can flake if the downloads fail, so run it several times until it succeeds. + go run github.com/googleapis/librarian/cmd/librarian@latest version || \ + go run github.com/googleapis/librarian/cmd/librarian@latest version || \ + go run github.com/googleapis/librarian/cmd/librarian@latest version + + V=$(go run github.com/googleapis/librarian/cmd/librarian@latest config get version) + + # This is a different download, so it can flake even after the first one succeeds. + go run github.com/googleapis/librarian/cmd/librarian@${V} version || \ + go run github.com/googleapis/librarian/cmd/librarian@${V} version || \ + go run github.com/googleapis/librarian/cmd/librarian@${V} version + + go run github.com/googleapis/librarian/cmd/librarian@${V} tidy + git diff + + - name: Check for diff + run: | + if ! git diff --exit-code; then + V=$(go run github.com/googleapis/librarian/cmd/librarian@latest config get version) + echo "librarian.yaml is not tidy. Please run:" + echo "" + echo " go run github.com/googleapis/librarian/cmd/librarian@${V} tidy" + echo "" + echo "to tidy librarian.yaml and commit the changes." + exit 1 + fi + From 2f49d0f479d0335f70dca8e440a048d41a6c5431 Mon Sep 17 00:00:00 2001 From: Noah Dietz Date: Fri, 22 May 2026 19:03:55 +0000 Subject: [PATCH 2/3] rename action --- .github/workflows/librarian_tidy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/librarian_tidy.yml b/.github/workflows/librarian_tidy.yml index f368302b6820..03ddf144633c 100644 --- a/.github/workflows/librarian_tidy.yml +++ b/.github/workflows/librarian_tidy.yml @@ -1,4 +1,4 @@ -name: Check that librarian.yaml is tidy +name: librarian tidy on: pull_request: From ce8219296d1e0b2a132dcb87972eaced2f1e199e Mon Sep 17 00:00:00 2001 From: Noah Dietz Date: Fri, 22 May 2026 19:42:18 +0000 Subject: [PATCH 3/3] remove retry --- .github/workflows/librarian_tidy.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/librarian_tidy.yml b/.github/workflows/librarian_tidy.yml index 03ddf144633c..ebbcf0c180a8 100644 --- a/.github/workflows/librarian_tidy.yml +++ b/.github/workflows/librarian_tidy.yml @@ -22,18 +22,7 @@ jobs: - name: Run librarian tidy run: | - # go run can flake if the downloads fail, so run it several times until it succeeds. - go run github.com/googleapis/librarian/cmd/librarian@latest version || \ - go run github.com/googleapis/librarian/cmd/librarian@latest version || \ - go run github.com/googleapis/librarian/cmd/librarian@latest version - V=$(go run github.com/googleapis/librarian/cmd/librarian@latest config get version) - - # This is a different download, so it can flake even after the first one succeeds. - go run github.com/googleapis/librarian/cmd/librarian@${V} version || \ - go run github.com/googleapis/librarian/cmd/librarian@${V} version || \ - go run github.com/googleapis/librarian/cmd/librarian@${V} version - go run github.com/googleapis/librarian/cmd/librarian@${V} tidy git diff