Skip to content

Commit 34b4e73

Browse files
authored
feat: publish versioned JSON Schema for AWF config file (#2375)
* Initial plan * feat: publish versioned JSON Schema for AWF config file Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/67604e30-6b7e-4524-8572-239a489b0733 * fix: use --print in release schema generation step * fix: address schema generator review feedback Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/db68ca3d-815c-49d2-8348-f5c8568b7e01 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 91b0094 commit 34b4e73

8 files changed

Lines changed: 828 additions & 53 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,13 @@ jobs:
520520
echo "Generated containers.txt:"
521521
cat release/containers.txt
522522
523+
- name: Generate versioned JSON Schema
524+
run: |
525+
mkdir -p release
526+
node scripts/generate-schema.mjs --version ${{ needs.bump-version.outputs.version }} --print > release/awf-config.schema.json
527+
echo "=== Schema preview (first 10 lines) ==="
528+
head -10 release/awf-config.schema.json
529+
523530
- name: Generate checksums
524531
run: |
525532
cd release
@@ -645,6 +652,7 @@ jobs:
645652
release/awf-bundle.js
646653
release/awf.tgz
647654
release/containers.txt
655+
release/awf-config.schema.json
648656
release/checksums.txt
649657
env:
650658
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The `--` separator divides firewall options from the command to run.
3434

3535
- [Quick start](docs/quickstart.md) — install, verify, and run your first command
3636
- [Usage guide](docs/usage.md) — CLI flags, domain allowlists, examples
37-
- [AWF config schema](docs/awf-config.schema.json) — machine-readable JSON Schema for JSON/YAML configs
37+
- [AWF config schema](docs/awf-config.schema.json) — machine-readable JSON Schema for JSON/YAML configs (also published as a [versioned release asset](https://github.com/github/gh-aw-firewall/releases/latest/download/awf-config.schema.json) for IDE autocomplete)
3838
- [AWF config spec](docs/awf-config-spec.md) — normative processing and precedence rules for tooling/compiler integration
3939
- [Enterprise configuration](docs/enterprise-configuration.md) — GitHub Enterprise Cloud and Server setup
4040
- [Chroot mode](docs/chroot-mode.md) — use host binaries with network isolation

docs/awf-config-spec.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ This document defines the canonical configuration model for AWF (`awf`) and is i
1010

1111
The machine-readable schema is published at:
1212

13-
- `docs/awf-config.schema.json`
13+
- `docs/awf-config.schema.json` — live schema (always reflects latest `main`)
14+
- GitHub release asset `awf-config.schema.json` — versioned, stable URL per release
15+
(e.g. `https://github.com/github/gh-aw-firewall/releases/download/v0.23.1/awf-config.schema.json`)
1416

1517
## 1. Conformance
1618

0 commit comments

Comments
 (0)