-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (55 loc) · 1.66 KB
/
validate.yml
File metadata and controls
68 lines (55 loc) · 1.66 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Validate Schemas
on:
push:
branches: ["main"]
tags-ignore: ["*"] # do not run this workflow for tags
pull_request:
branches: ["main"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
validate:
name: validate
runs-on: ubuntu-latest
env:
FORCE_COLOR: "1"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}
- name: Normalize git on runner (LF)
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Validate schemas
run: npm run validate:schemas
- name: Validate examples
run: npm run validate:examples
# Regenerate checksums only on branches (not tags)
- name: Generate checksums
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: node scripts/generate-checksums.mjs schemas/v1.0.0 checksums.txt
# Compare checksums only on branches (not tags)
- name: Verify checksums are current
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: git diff --exit-code checksums.txt
# Upload artifact on failure to help debug
- name: Upload checksums artifact (for debugging)
if: always()
uses: actions/upload-artifact@v4
with:
name: checksums.txt
path: checksums.txt