Skip to content

Commit 9de2628

Browse files
committed
add scheduled GHA workflow to check for changes in the tombstone protobuf schema
1 parent cda8031 commit 9de2628

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Check Tombstone Proto Schema
2+
3+
on:
4+
schedule:
5+
- cron: '0 9 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v6
14+
15+
- name: Check for newer Tombstone proto schema
16+
run: ./scripts/check-tombstone-proto-schema.sh
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
TRACKED_COMMIT="981d145117e8992842cdddee555c57e60c7a220a"
5+
6+
# tail -n +2 to remove the magic anti-XSSI prefix from the Gitiles JSON response
7+
LATEST_COMMIT=$(curl -sf \
8+
'https://android.googlesource.com/platform/system/core/+log/refs/heads/main/debuggerd/proto/tombstone.proto?format=JSON' \
9+
| tail -n +2 \
10+
| jq -r '.log[0].commit')
11+
12+
if [ -z "$LATEST_COMMIT" ] || [ "$LATEST_COMMIT" = "null" ]; then
13+
echo "ERROR: Failed to fetch latest commit from Gitiles" >&2
14+
exit 1
15+
fi
16+
17+
echo "Tracked commit: $TRACKED_COMMIT"
18+
echo "Latest commit: $LATEST_COMMIT"
19+
20+
if [ "$LATEST_COMMIT" != "$TRACKED_COMMIT" ]; then
21+
echo "Schema has been updated! Latest: https://android.googlesource.com/platform/system/core/+/${LATEST_COMMIT}/debuggerd/proto/tombstone.proto"
22+
exit 1
23+
fi
24+
25+
echo "Schema is up to date."

0 commit comments

Comments
 (0)