Skip to content

Commit 4f986c7

Browse files
committed
feat: add json files format check
1 parent a219303 commit 4f986c7

37 files changed

+1067
-155
lines changed

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# CODEOWNERS reference: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
2+
3+
# These owners will be the default owners for everything in
4+
# the repo. Unless a later match takes precedence,
5+
# the following users/teams will be requested for
6+
# review when someone opens a pull request.
7+
* @boeing/config-file-validator-maintainers

.github/workflows/changelog.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Check Changelog
3+
on:
4+
pull_request:
5+
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
Check-Changelog:
14+
name: Check Changelog Action
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Harden the runner (Audit all outbound calls)
18+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
19+
with:
20+
egress-policy: audit
21+
22+
- uses: tarides/changelog-check-action@0189fc7eedec3ef3e9648c713908f6f2a6e99057 # v3
23+
with:
24+
changelog: CHANGELOG.md

.github/workflows/go.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Harden Runner
22-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
22+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
2323
with:
2424
egress-policy: audit
2525

@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ubuntu-latest
3939
steps:
4040
- name: Harden Runner
41-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
41+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
4242
with:
4343
egress-policy: audit
4444

@@ -60,7 +60,7 @@ jobs:
6060
runs-on: ubuntu-latest
6161
steps:
6262
- name: Harden Runner
63-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
63+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
6464
with:
6565
egress-policy: audit
6666

@@ -84,7 +84,7 @@ jobs:
8484
contents: write
8585
steps:
8686
- name: Harden Runner
87-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
87+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
8888
with:
8989
egress-policy: audit
9090

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ${{ matrix.os }}
2727
steps:
2828
- name: Harden Runner
29-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
29+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
3030
with:
3131
egress-policy: audit
3232

.github/workflows/goreportcard.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ${{ matrix.os }}
2020
steps:
2121
- name: Harden Runner
22-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
22+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
2323
with:
2424
egress-policy: audit
2525

.github/workflows/mega-linter.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: Harden Runner
28-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
28+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
2929
with:
3030
egress-policy: audit
3131

@@ -37,7 +37,7 @@ jobs:
3737

3838
# MegaLinter
3939
- name: MegaLinter
40-
uses: oxsecurity/megalinter@e08c2b05e3dbc40af4c23f41172ef1e068a7d651 # v8.8.0
40+
uses: oxsecurity/megalinter@62c799d895af9bcbca5eacfebca29d527f125a57 # v9.1.0
4141
id: megalinter
4242
env:
4343
VALIDATE_ALL_CODEBASE: true
@@ -46,7 +46,7 @@ jobs:
4646
# Upload MegaLinter artifacts
4747
- name: Archive production artifacts
4848
if: success() || failure()
49-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
49+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
5050
with:
5151
name: MegaLinter reports
5252
path: |

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
steps:
3434
- name: Harden Runner
35-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
35+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
3636
with:
3737
egress-policy: audit
3838

@@ -53,7 +53,7 @@ jobs:
5353
runs-on: ubuntu-latest
5454
steps:
5555
- name: Harden Runner
56-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
56+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
5757
with:
5858
egress-policy: audit
5959

.github/workflows/scorecard.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
steps:
3333
- name: Harden Runner
34-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
34+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
3535
with:
3636
egress-policy: audit
3737

@@ -41,7 +41,7 @@ jobs:
4141
persist-credentials: false
4242

4343
- name: "Run analysis"
44-
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
44+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
4545
with:
4646
results_file: results.sarif
4747
results_format: sarif
@@ -55,7 +55,7 @@ jobs:
5555
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
5656
# format to the repository Actions tab.
5757
- name: "Upload artifact"
58-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v3.pre.node20
58+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v3.pre.node20
5959
with:
6060
name: SARIF file
6161
path: results.sarif
@@ -64,6 +64,6 @@ jobs:
6464
# Upload the results to GitHub's code scanning dashboard (optional).
6565
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
6666
- name: "Upload to code-scanning"
67-
uses: github/codeql-action/upload-sarif@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.29.5
67+
uses: github/codeql-action/upload-sarif@16140ae1a102900babc80a33c44059580f687047 # v3.29.5
6868
with:
6969
sarif_file: results.sarif

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
12+
- JSON formatting functionality with `--check-format` flag
13+
- CLI flag `--check-format` to enable formatting check of valid config files, only JSON is supported
14+
- Checks JSON format with consistent 2-space indentation
15+
- Added a new interface method `ValidateFormat` for format validation
16+
- CHANGELOG.md file
17+
- Github action to verify that changelog was changed for each PR
18+
- CODEOWNERS file
19+
20+
### Changed
21+
22+
- Interface method name change
23+
- `Validate` interface renamed to `ValidateSyntax`
24+
- Test examples for good JSON config files were updated to have consistent 2-space indentation
25+
- Build instructions for MacOS were updated to default to arm64
26+
27+
### Fixed
28+
29+
- Windows build instructions did not have the correct variable declarations

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.25@sha256:8305f5fa8ea63c7b5bc85bd223ccc62941f852318ebfbd22f53bbd0b358c07e1 AS go-builder
1+
FROM golang:1.25@sha256:6ea52a02734dd15e943286b048278da1e04eca196a564578d718c7720433dbbe AS go-builder
22
ARG VALIDATOR_VERSION=unknown
33
COPY . /build/
44
WORKDIR /build
@@ -11,7 +11,7 @@ RUN CGO_ENABLED=0 \
1111
-o validator \
1212
cmd/validator/validator.go
1313

14-
FROM alpine:3.22@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
14+
FROM alpine:3.22@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412
1515
USER user
1616
COPY --from=go-builder /build/validator /
1717
HEALTHCHECK NONE

0 commit comments

Comments
 (0)