Skip to content
Merged
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
10 changes: 8 additions & 2 deletions .github/workflows/librarian_tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,20 +17,24 @@ 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
with:
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'
Expand All @@ -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"
Expand Down
Loading