Skip to content

Add CI workflow to validate JSON files on push and PR - #1

Merged
anaflightsim merged 2 commits into
mainfrom
copilot/setup-gh-actions-validate-json
Mar 29, 2026
Merged

Add CI workflow to validate JSON files on push and PR#1
anaflightsim merged 2 commits into
mainfrom
copilot/setup-gh-actions-validate-json

Conversation

Copilot AI commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

Adds a GitHub Actions workflow that validates all JSON files in the repository, triggered on every push and pull request.

  • Workflow trigger: Runs on push (all branches) and pull_request, ensuring validation on every commit
  • Validation: Uses Python's built-in json.tool to parse each *.json file, reporting per-file pass/fail with summary counts
  • Permissions: Scoped to contents: read (least privilege)

Blocking merges

To enforce validation before merge, a repo admin must add a branch protection rule on main requiring the validate-json status check to pass.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 JSON workflow triggered on push and pull_request
  • Validates all *.json files via python3 -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

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

Copilot uses AI. Check for mistakes.
@anaflightsim
anaflightsim requested a review from Copilot March 29, 2026 22:18
@anaflightsim
anaflightsim marked this pull request as ready for review March 29, 2026 22:18
@anaflightsim
anaflightsim merged commit e84cdb1 into main Mar 29, 2026
9 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

3 participants