Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/_shellcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: ShellCheck

on:
workflow_call:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7

# hack/ holds the drift and coverage gates. They decide whether CI
# passes, so a quoting mistake there fails builds or, worse, makes a
# check silently succeed.
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
with:
scandir: hack
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
unicode:
uses: ./.github/workflows/_unicode-lint.yaml

shellcheck:
uses: ./.github/workflows/_shellcheck.yaml

go:
uses: ./.github/workflows/_go.yaml

Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,15 @@ check-manifests: manifests generate ## Check for CRD and deepcopy drift.
exit 1; \
fi

.PHONY: shellcheck
shellcheck: ## Lint the shell scripts in hack/.
@if ! command -v shellcheck >/dev/null 2>&1; then \
echo "error: shellcheck not found on PATH."; \
echo "Install it from https://github.com/koalaman/shellcheck#installing."; \
exit 1; \
fi
shellcheck hack/*.sh

.PHONY: check-rbac
check-rbac: manifests ## Check the chart RBAC matches the kubebuilder markers.
./hack/check-rbac.sh
Expand All @@ -186,7 +195,7 @@ check-helm-docs: helm-docs helm-schema ## Check the chart README and schema are
fi

.PHONY: ci
ci: lint vet check-tidy check-coverage check-manifests vulncheck helm-lint helm-unittest check-helm-docs check-rbac ## Run all CI checks locally.
ci: lint vet shellcheck check-tidy check-coverage check-manifests vulncheck helm-lint helm-unittest check-helm-docs check-rbac ## Run all CI checks locally.
@echo "All CI checks passed."

##@ E2E
Expand Down