diff --git a/.github/workflows/test-rego.yaml b/.github/workflows/test-rego.yaml index be946ef8..2daec297 100644 --- a/.github/workflows/test-rego.yaml +++ b/.github/workflows/test-rego.yaml @@ -36,18 +36,14 @@ jobs: with: go-version: ${{ env.GO_VERSION }} - - name: Setup OPA - uses: ./.github/actions/setup-opa - - name: Rego Check - run: opa check lib checks --v0-v1 + run: go run ./cmd/opa check lib checks --v0-v1 - name: OPA Format run: | - files=$(opa fmt --list . | grep -v vendor || true) - if [ -n "$files" ]; then - echo "=== The following files are not formatted ===" - echo "$files" + make fmt-rego + if [ -n "$(git status --porcelain)" ]; then + echo "Run 'make fmt-rego' and push it" exit 1 fi diff --git a/Makefile b/Makefile index ae1fd6ee..df04d27a 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ rego: fmt-rego test-rego .PHONY: fmt-rego fmt-rego: - opa fmt -w lib/ checks/ examples/ .regal/rules + go run ./cmd/opa fmt -w lib/ checks/ examples/ .regal/rules .PHONY: test-rego test-rego: