Skip to content

ci(dogfood): add actionlint, repo-wide SHA-pin audit, properties.json schema#10

Open
cryptoxdog wants to merge 2 commits into
mainfrom
ci/dogfood-actionlint-pin-audit-schema
Open

ci(dogfood): add actionlint, repo-wide SHA-pin audit, properties.json schema#10
cryptoxdog wants to merge 2 commits into
mainfrom
ci/dogfood-actionlint-pin-audit-schema

Conversation

@cryptoxdog

Copy link
Copy Markdown

What

Three new self-CI checks for this repo, dogfooding its own template/pack surface:

  1. actionlint (.github/workflows/actionlint.yml) — lints workflow-templates/*.yml + l9-ci-pack/workflows/*.yml. nullglob-safe, so it works today (9 legacy templates) and auto-picks-up l9-ci-pack/ once feat(l9-ci-pack): full v2 instantiation pack + legacy-mark @v1 starters + tag-v1.sh fix #8 merges.
  2. Repo-wide SHA-pin audit (ops/audit-sha-pins.sh + .github/workflows/sha-pin-audit.yml) — generalizes validate-starters.sh's l9-ci-pack-only @main check to every uses: line in workflow-templates/, l9-ci-pack/workflows/, and .github/workflows/. Only full 40-char SHAs or the documented frozen Quantum-L9/l9-ci-core tags (@v1/@v2/@v2.0.0) pass.
  3. properties.json schema validation (ops/validate-properties-json.py + ops/schemas/workflow-template-properties.schema.json + .github/workflows/properties-json-schema.yml) — structural JSON-Schema check for every workflow-templates/*.properties.json.

Why

User asked why this repo only shows 2 checks when there "should be 7 or 9 available." Root cause: workflow-templates/*.yml never runs as CI in this repo — those files are GitHub's starter-workflow gallery, only executed once copied into other repos. This PR adds real, repo-native CI instead.

Note on properties.json categories

Deliberately not enum-validated. The SchemaStore community schema for this exact file type (github-workflow-template-properties.json) encodes only github/linguist's 865 language names and omits GitHub's 11 official fixed category buckets (Automation, continuous-integration, deployment, etc. — per actions/starter-workflows's README). A strict enum would immediately false-flag values this repo's own templates already use (CI, CD, Security, Governance, Supply Chain). Validation here is structural (required fields, types) only. Full rationale in the schema file's $comment and in CONTRIBUTING.md.

Verification

  • actionlint — clean on all 9 current templates; self-linted the 3 new workflow files too.
  • SHA-pin audit — 33/39 real refs checked clean (repo-wide, once l9-ci-pack merges); positive baseline + negative test (injected @main + @v4, both caught, then a regex bug missing - uses: list-item syntax was found and fixed) done locally before push.
  • properties.json schema — 9/9 (12/12 once feat(l9-ci-pack): full v2 instantiation pack + legacy-mark @v1 starters + tag-v1.sh fix #8 merges) valid; negative test (missing required field + wrong type) caught correctly.
  • Existing ops/validate-starters.sh — still 0 regressions.

Checklist

  • Lint passes (actionlint self-check on new workflow files)
  • Tests pass (all 3 new gates run clean locally against real repo content, plus positive/negative tests)
  • Documented in CONTRIBUTING.md under new "This Repo's Own CI" section

Made with Cursor

… schema

Quantum-L9/.github only ran 2 checks (SonarCloud + validate-starters.sh, the
latter still pending in PR #8) because workflow-templates/*.yml never
executes in this repo -- those 9 (soon 12) files are GitHub's starter-workflow
gallery, only ever run when copied into OTHER repos. This adds three real
self-CI gates that dogfood the repo's own template/pack surface:

- actionlint on workflow-templates/ + l9-ci-pack/workflows/ (glob is
  nullglob-safe, so it lints the 9 legacy templates today and picks up
  l9-ci-pack/ automatically once PR #8 merges). Pinned to actionlint v1.7.12
  by the download script's commit SHA.
- ops/audit-sha-pins.sh: repo-wide SHA-pin audit generalizing
  validate-starters.sh's l9-ci-pack-only @main check to every uses: line in
  workflow-templates/, l9-ci-pack/workflows/, and .github/workflows/. Allows
  only full 40-char SHAs or the documented frozen Quantum-L9/l9-ci-core tags
  (@v1 legacy, @v2/@v2.0.0 current). Verified against real content with both
  positive (33/39 refs clean) and negative (injected @main + @v4, both
  caught) tests; an initial regex bug that missed the common "- uses:"
  list-item syntax was found and fixed during testing.
- ops/validate-properties-json.py + ops/schemas/workflow-template-properties.schema.json:
  structural JSON-Schema validation for every workflow-templates/*.properties.json.
  categories is intentionally left without an enum -- verified the
  SchemaStore community schema for this exact file type encodes only
  github/linguist's 865 language names and omits GitHub's 11 official fixed
  category buckets (Automation, continuous-integration, etc.), so a strict
  enum check would immediately false-flag values this repo's own templates
  already use. Verified against all 9 existing files (12 once PR #8 merges)
  plus a negative test (missing required field + wrong type, both caught).

Documented all three in CONTRIBUTING.md under a new "This Repo's Own CI"
section, alongside the existing SonarCloud + validate-starters.sh gates.

User-approved: add more CI checks to this repo (actionlint, SHA-pin audit,
properties.json schema were the three selected of six options presented).

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

- actionlint.yml: download the actionlint install script to a file and
  verify its sha256 before executing (was curl|bash with no verification —
  BLOCKER githubactions:S8482).
- properties-json-schema.yml: pin jsonschema==4.26.0 and add
  --only-binary :all: to the pip install (MAJOR githubactions:S8541/S8544);
  wrapped in a run: | block since the bare "--only-binary :all:" plain
  scalar tripped actionlint's YAML parser (colon-space ambiguity).
- ops/audit-sha-pins.sh: assign $1 to a local var in is_sha() before use,
  and use [[ instead of [ for the two remaining conditionals (MAJOR
  shelldre:S7679/S7688 x2). Re-verified with shellcheck (clean) and the
  existing positive/negative test suite (unchanged: 20/39 refs clean
  depending on pre/post PR #8 merge, injected violations still caught).

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant