Skip to content

Modernize CI: harden workflow, replace JSON validator, add dependabot#1549

Merged
jeefy merged 1 commit intocncf:mainfrom
cblecker:modernize-ci-workflow
Mar 11, 2026
Merged

Modernize CI: harden workflow, replace JSON validator, add dependabot#1549
jeefy merged 1 commit intocncf:mainfrom
cblecker:modernize-ci-workflow

Conversation

@cblecker
Copy link
Copy Markdown
Member

@cblecker cblecker commented Mar 10, 2026

Summary

  • Harden GitHub Actions workflow: Add permissions: contents: read (least-privilege), upgrade actions/checkout to v6 with persist-credentials: false
  • Replace JSON validator: Swap the unmaintained docker://orrosenblatt/validate-json-action:latest container for check-jsonschema (from the python-jsonschema org — maintainers of the reference Python JSON Schema implementation)
  • Add dependabot config: Automated weekly PRs to keep GitHub Actions versions current

Schema change detail

The email regex pattern in schema.json contained \! — a backslash-escaped exclamation mark. The ! character is not a special regex character and does not need escaping. Per ECMA-262 (the JavaScript regex standard), \! is technically an invalid escape sequence.

The old validator (AJV, via the Docker action) was lenient about this and silently treated \! as !. check-jsonschema correctly rejects the invalid escape per the spec. The fix is simply removing the unnecessary backslash: \!!.

There is no behavioral change — both \! (where tolerated) and ! match the literal ! character. The set of valid/invalid email strings matched by the pattern is identical before and after this change.

- "pattern": "^[^\\s@]+\\![^\\s@]+\\.[^\\s@]+$"
+ "pattern": "^[^\\s@]+![^\\s@]+\\.[^\\s@]+$"

Verification

  • check-jsonschema --schemafile schema.json people.json passes locally against the current people.json

Test plan

  • CI workflow runs successfully on this PR (the workflow itself validates the schema)
  • Review validate.yml for correctness
  • Review schema.json pattern change
  • Review dependabot.yml config

@cblecker cblecker force-pushed the modernize-ci-workflow branch 2 times, most recently from 218c526 to 8540e53 Compare March 10, 2026 19:21
Upgrade checkout to v6 with persist-credentials: false, add read-only
permissions, replace unmaintained Docker-based JSON validator with
check-jsonschema, fix invalid \\! escape in schema email pattern, and
add dependabot config for automated action updates.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Christoph Blecker <admin@toph.ca>
@cblecker cblecker force-pushed the modernize-ci-workflow branch from 8540e53 to 6637729 Compare March 10, 2026 19:28
@jeefy jeefy merged commit 33945cd into cncf:main Mar 11, 2026
3 checks passed
@cblecker cblecker deleted the modernize-ci-workflow branch March 11, 2026 13:54
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.

2 participants