Skip to content

Commit b799c3a

Browse files
ci check
1 parent 54f6396 commit b799c3a

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/check-logs.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Check log.go files
2+
on: [ pull_request ]
3+
4+
jobs:
5+
check-logs:
6+
runs-on: ubuntu-4
7+
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Set up Go 1.25.1
15+
uses: actions/setup-go@v5
16+
with:
17+
go-version: '1.25.1'
18+
19+
- name: Check log.go files
20+
run: |
21+
chmod +x hack/gen-logs.sh hack/check-logs.sh
22+
./hack/check-logs.sh

hack/check-logs.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ROOT_DIR="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
5+
cd "$ROOT_DIR"
6+
7+
# Regenerate all log.go files
8+
./hack/gen-logs.sh
9+
10+
# Fail if that changed anything
11+
if ! git diff --quiet -- ./; then
12+
echo "ERROR: log.go files are out of date. Please run:"
13+
echo " ./hack/gen-logs.sh"
14+
echo "and commit the changes."
15+
echo
16+
git diff --stat -- ./ || true
17+
exit 1
18+
fi
19+
20+
echo "log.go files are up to date."

0 commit comments

Comments
 (0)