Skip to content

Commit bec3a71

Browse files
committed
ci: switch schema-sync workflow to use main branch
1 parent 6c0aa03 commit bec3a71

1 file changed

Lines changed: 41 additions & 5 deletions

File tree

.github/workflows/schema-sync.yml

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,44 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
schema-sync:
10-
uses: scanoss/scanoss-devops/.github/workflows/schema-sync-check.yml@feat/SP-4166/schema-sync-ci
11-
with:
12-
source-file: scanoss-settings-schema.json
13-
target-file: src/scanoss/data/scanoss-settings-schema.json
9+
check-schema-sync:
10+
name: Check Schema Sync
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout consumer repo
14+
uses: actions/checkout@v4
15+
16+
- name: Checkout schema repo
17+
uses: actions/checkout@v4
18+
with:
19+
repository: scanoss/schema
20+
ref: main
21+
path: .schema-source
22+
23+
- name: Compare schemas
24+
id: compare
25+
shell: bash
26+
run: |
27+
source_path=".schema-source/scanoss-settings-schema.json"
28+
target_path="src/scanoss/data/scanoss-settings-schema.json"
29+
30+
if [ ! -f "$source_path" ]; then
31+
echo "::error::Source schema not found in scanoss/schema@main"
32+
exit 1
33+
fi
34+
35+
if [ ! -f "$target_path" ]; then
36+
echo "::error::Local vendored schema not found: $target_path"
37+
exit 1
38+
fi
39+
40+
if diff -u "$source_path" "$target_path"; then
41+
echo "Schema is in sync."
42+
else
43+
echo ""
44+
echo "::error::Schema out of sync: $target_path"
45+
echo ""
46+
echo "To fix, run:"
47+
echo " curl -sL https://raw.githubusercontent.com/scanoss/schema/main/scanoss-settings-schema.json -o $target_path"
48+
exit 1
49+
fi

0 commit comments

Comments
 (0)