Skip to content

Commit

Permalink
add provider's JSON validation CI pipeline definition
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Kisler <[email protected]>
  • Loading branch information
kislerdm committed Jan 30, 2024
1 parent a1db6b6 commit f8f34fb
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/validate-json-provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,31 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: actions/setup-go@v4
with:
go-version-file: './src/go.mod'

- name: Validate JSON
- name: Build validator
working-directory: ./src
run: |
for path in $(git diff HEAD~1 HEAD --name-only)
mkdir -p /tmp/validate
go build -o /tmp/validate/run ./cmd/validate/main.go
chmod +x /tmp/validate/run
- name: List updated filed
id: updated
uses: tj-actions/changed-files@v42
with:
files: providers/**/*.json

- name: Validate JSON
env:
CHANGED_FILES: ${{ steps.updated.outputs.all_changed_files }}
run: |
for path in "$CHANGED_FILES"
do
go run ./cmd/validate/main.go provider $path
/tmp/validate/run provider "$path"
done

0 comments on commit f8f34fb

Please sign in to comment.