forked from googleapis/google-cloud-python
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 1.15 KB
/
Copy pathlibrarian_tidy.yml
File metadata and controls
42 lines (35 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: librarian tidy
on:
pull_request:
permissions:
contents: read
jobs:
tidy-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4
id: changes
with:
filters: |
librarian:
- 'librarian.yaml'
- uses: googleapis/librarian@main # zizmor: ignore[unpinned-uses]
- name: Run librarian tidy
if: steps.changes.outputs.librarian == 'true'
run: librarian tidy
- name: Check for diff
if: steps.changes.outputs.librarian == 'true'
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