-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
57 lines (53 loc) · 2.01 KB
/
Copy pathaction.yml
File metadata and controls
57 lines (53 loc) · 2.01 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
name: bqschema
description: Gate BabelQueue per-URN schema changes in CI — validate the registry and lint backward-compatibility (versioning-policy §3)
author: muhammetsafak
branding:
icon: git-merge
color: blue
inputs:
version:
description: bqschema version to install (a release tag like "v0.1.0", or "latest")
required: false
default: latest
command:
description: bqschema subcommand to run — "check" (registry self-validation), "validate", "compat", or "export-asyncapi"
required: false
default: check
registry:
description: Path to the registry.json manifest (used by check/validate/export-asyncapi)
required: false
default: registry.json
dir:
description: Working directory to run bqschema in (registry paths resolve relative to this)
required: false
default: "."
args:
description: >-
Extra arguments appended verbatim after the subcommand, for cases the typed inputs do not cover
(e.g. `compat`'s two positional <old> <new> schema files, or `validate`'s envelope files).
When set, this is the escape hatch — `registry` is still passed for check/validate/export-asyncapi.
required: false
default: ""
runs:
using: composite
steps:
- uses: actions/setup-go@v5
with:
go-version: stable
- shell: bash
run: go install github.com/babelqueue/babelqueue-registry/cmd/bqschema@${{ inputs.version }}
# bqschema exits non-zero on a gate failure (1 = breaking change / validation failure,
# 2 = usage or IO error), so a failing schema change fails the step and blocks the merge.
# `compat` takes two positional schema files — pass them via `args`; `registry` is ignored there.
- shell: bash
working-directory: ${{ inputs.dir }}
run: |
cmd="${{ inputs.command }}"
case "$cmd" in
compat)
bqschema "$cmd" ${{ inputs.args }}
;;
*)
bqschema "$cmd" --registry "${{ inputs.registry }}" ${{ inputs.args }}
;;
esac