From ab377744f6346accf228a0ce0b0b1906e28355a1 Mon Sep 17 00:00:00 2001 From: Santi Quiroga Date: Thu, 19 Nov 2026 19:49:26 +0000 Subject: [PATCH] ci: skip librarian setup in librarian_tidy when unmodified --- .github/workflows/librarian_tidy.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/librarian_tidy.yml b/.github/workflows/librarian_tidy.yml index e830d1d3f187..443e56786d03 100644 --- a/.github/workflows/librarian_tidy.yml +++ b/.github/workflows/librarian_tidy.yml @@ -2,10 +2,13 @@ name: librarian tidy on: pull_request: + push: + branches: + - main concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read @@ -14,10 +17,12 @@ jobs: tidy-check: name: Verify librarian.yaml is tidy runs-on: ubuntu-latest + timeout-minutes: 10 steps: - name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: + fetch-depth: 2 persist-credentials: false - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 id: changes @@ -25,9 +30,11 @@ jobs: filters: | librarian: - 'librarian.yaml' + - '.github/workflows/librarian_tidy.yml' # Version of librarian is pulled from librarian.yaml, # action is pinned to commit SHA to satisfy blanket security policy. - uses: googleapis/librarian@35997441eafc2b02716804f9baba1e3f04f8a44f # v0.31.1 + if: steps.changes.outputs.librarian == 'true' - name: Run librarian tidy if: steps.changes.outputs.librarian == 'true' @@ -37,7 +44,6 @@ jobs: if: steps.changes.outputs.librarian == 'true' run: | if ! git diff --exit-code; then - V=$(librarian config get version 2>/dev/null || echo "latest") echo "librarian.yaml is not tidy. Please run:" echo "" echo " librarian tidy"