Skip to content

Update github actions (main) (minor) #191

Update github actions (main) (minor)

Update github actions (main) (minor) #191

Workflow file for this run

name: Checks
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
Checks:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
disable-telemetry: true
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Go environment
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
cache: true
go-version-file: go.mod
cache-dependency-path: '**/go.sum'
# Removed go version check as it's specific to the original repo
- name: Build all
run: make all
- name: Test
run: make test
# Coverage reporting removed for now - can be added later if needed
# If enterprisecontractpolicy_types.go is updated without a corresponding change to the crd
# an uncommitted change can show.
- name: Check for uncommitted changes
run: |
if ! git diff --exit-code -s; then
for f in $(git diff --exit-code --name-only); do
echo "::error file=$f,line=1,col=1,endColumn=1::File was modified in build"
echo -e "\033[1;33mHint:\033[0m Maybe you need to run \033[1;32mmake all\033[0m"
done
exit 1
fi