Skip to content

Commit ac698b2

Browse files
authored
chore(ci): add librarian tidy check (#17236)
1 parent 3397d1b commit ac698b2

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: librarian tidy
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'librarian.yaml'
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
tidy-check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v6
17+
18+
- name: Install Go
19+
uses: actions/setup-go@v6
20+
with:
21+
go-version: '1.26.x'
22+
23+
- name: Run librarian tidy
24+
run: |
25+
V=$(go run github.com/googleapis/librarian/cmd/librarian@latest config get version)
26+
go run github.com/googleapis/librarian/cmd/librarian@${V} tidy
27+
git diff
28+
29+
- name: Check for diff
30+
run: |
31+
if ! git diff --exit-code; then
32+
V=$(go run github.com/googleapis/librarian/cmd/librarian@latest config get version)
33+
echo "librarian.yaml is not tidy. Please run:"
34+
echo ""
35+
echo " go run github.com/googleapis/librarian/cmd/librarian@${V} tidy"
36+
echo ""
37+
echo "to tidy librarian.yaml and commit the changes."
38+
exit 1
39+
fi
40+

0 commit comments

Comments
 (0)