GitHub Action to validate K9 configuration files in your repository.
K9 is a Nickel-based configuration contract format used by the contractile
system for deployment validation and policy enforcement. Files use the .k9
or .k9.ncl extension and follow a security-tiered "leash" model:
kennel (data-only), yard (validated), and hunt (full execution).
-
K9! magic number — First non-empty line must be exactly
K9! -
SPDX header — Verifies
SPDX-License-Identifierin the first 10 lines -
Pedigree block — Requires a
pedigree = { … }section with:-
namefield (inpedigree.metadataor directly) -
versionorschema_versionfield
-
-
Security level —
leashorsecurity_levelmust be one of:kennel,yard,hunt -
Hunt-level signature — Files at
huntsecurity level must include asignatureorsignature_requiredfield
Add to your workflow:
name: Validate K9
on: [push, pull_request]
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hyperpolymath/k9-validate-action@v1
with:
path: '.' # Directory to scan (default: repo root)
strict: 'false' # Promote warnings to errors (default: false)| Input | Default | Description |
|---|---|---|
|
|
Directory path to scan for K9 files |
|
|
When |
| Level | Trust | Requirements |
|---|---|---|
|
Data-only |
No signature required. Pure configuration values. |
|
Validated |
Nickel contracts enforced. Type-checked before use. |
|
Full access |
Signature required. Can execute commands and access system resources. |
Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
SPDX-License-Identifier: PMPL-1.0-or-later
See LICENSE for details.