diff --git a/.github/workflows/scan-go-mod-tidy.yml b/.github/workflows/scan-go-mod-tidy.yml deleted file mode 100644 index 2eab6ce696..0000000000 --- a/.github/workflows/scan-go-mod-tidy.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Validate Go Mod Tidy -on: - pull_request: - paths: - - "go.mod" - - "go.sum" - -permissions: - contents: read - -jobs: - validate: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Setup golang - uses: ./.github/actions/golang - - - name: Check go mod tidy - run: make test-go-mod-tidy - - - name: Save logs - if: always() - uses: ./.github/actions/save-logs diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 38e3b129cf..5e96cba653 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,10 +47,6 @@ repos: files: .go$ language: system pass_filenames: true - - id: check-go-mod-tidy - name: Check for out of sync Go module dependencies - entry: make test-go-mod-tidy - language: system - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.14.0 hooks: diff --git a/Makefile b/Makefile index 18a61a82cd..7a81ba94eb 100644 --- a/Makefile +++ b/Makefile @@ -78,6 +78,7 @@ delete-packages: ## Delete all Zarf package tarballs in the project recursively # Note: the path to the main.go file is not used due to https://github.com/golang/go/issues/51831#issuecomment-1074188363 .PHONY: build build: ## Build the Zarf CLI for the machines OS and architecture + go mod tidy $(MAKE) $(BUILD_CLI_FOR_SYSTEM) build-cli-linux-amd: ## Build the Zarf CLI for Linux on AMD64 @@ -220,10 +221,6 @@ test-docs-and-schema: test-cves: go run main.go tools sbom scan . -o json --exclude './site' --exclude './examples' | grype --fail-on low -# INTERNAL: used to test that a dev has ran `go mod tidy` in their PR -test-go-mod-tidy: - ./hack/check-go-mod-tidy.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 diff --git a/hack/check-go-mod-tidy.sh b/hack/check-go-mod-tidy.sh deleted file mode 100755 index d9603736e8..0000000000 --- a/hack/check-go-mod-tidy.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -go mod tidy -if ! git diff --quiet go.mod go.sum; then - echo "ERROR: Changes detected after running 'go mod tidy'. Please run 'go mod tidy' and commit the changes." - exit 1 -fi