Add CI workflow to validate JSON files on push and PR - #1
Conversation
Agent-Logs-Url: https://github.com/GroundServicesJP/GroundServicesJP_JSONService/sessions/fcd8c8bf-d92b-4c3e-a9d2-197984bffb63 Co-authored-by: anaflightsim <66984894+anaflightsim@users.noreply.github.com>
…equests Agent-Logs-Url: https://github.com/GroundServicesJP/GroundServicesJP_JSONService/sessions/ce4b38a4-acdf-46f0-9406-73d44a150cb7 Co-authored-by: anaflightsim <66984894+anaflightsim@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow to validate repository JSON files on every push and pull request, helping prevent invalid JSON from being merged.
Changes:
- Introduces a new
Validate JSONworkflow triggered onpushandpull_request - Validates all
*.jsonfiles viapython3 -m json.tool, reporting per-file results and failing the job on any invalid JSON
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| jobs: | ||
| validate-json: | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
Consider pinning the runner image (e.g., ubuntu-24.04 instead of ubuntu-latest) to avoid unexpected CI behavior changes when GitHub updates the default image.
| runs-on: ubuntu-latest | |
| runs-on: ubuntu-24.04 |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
For better supply-chain hardening, consider pinning actions/checkout to a specific commit SHA instead of a moving tag like @v4, which improves reproducibility and reduces risk from upstream tag changes.
| uses: actions/checkout@v4 | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds a GitHub Actions workflow that validates all JSON files in the repository, triggered on every push and pull request.
push(all branches) andpull_request, ensuring validation on every commitjson.toolto parse each*.jsonfile, reporting per-file pass/fail with summary countscontents: read(least privilege)Blocking merges
To enforce validation before merge, a repo admin must add a branch protection rule on
mainrequiring thevalidate-jsonstatus check to pass.