Skip to content

Commit

Permalink
check docs and schema
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 committed Sep 3, 2024
1 parent e505683 commit 9b0a81a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/check-go-mod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check for go mod changes
on:
pull_request:
merge_group:

permissions:
contents: read

jobs:
validate-go-mod:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup golang
uses: ./.github/actions/golang

- name: Docs and schemas
run: "make test-go-mod"

- name: Save logs
if: always()
uses: ./.github/actions/save-logs
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ test-docs-and-schema:
test-cves:
go run main.go tools sbom scan . -o json --exclude './site' --exclude './examples' | grype --fail-on low

test-go-mod:
go mod tidy
hack/check-go-mod.sh

cve-report: ## Create a CVE report for the current project (must `brew install grype` first)
@test -d ./build || mkdir ./build
go run main.go tools sbom scan . -o json --exclude './site' --exclude './examples' | grype -o template -t hack/grype.tmpl > build/zarf-known-cves.csv
Expand Down
11 changes: 11 additions & 0 deletions hack/check-go-mod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -euo pipefail

if [ -z "$(git status -s go.mod go.sum)" ]; then
echo "Success!"
exit 0
else
git diff go.mod go.sum
exit 1
fi

0 comments on commit 9b0a81a

Please sign in to comment.