Skip to content

Commit 77fd7da

Browse files
authored
fix(make): make sure github action can check schemas change (#1651)
1 parent 78ee833 commit 77fd7da

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/build-test-deploy.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ jobs:
8181
- uses: actions/checkout@v4
8282
with:
8383
fetch-depth: 0
84-
- run: make check-schemas
84+
path: github.com/replicatedhq/troubleshoot
85+
- run: |
86+
cd github.com/replicatedhq/troubleshoot
87+
make check-schemas
8588
8689
compile-preflight:
8790
runs-on: ubuntu-latest
@@ -388,4 +391,4 @@ jobs:
388391
# if the validate-pr-tests job was successful, this job will succeed
389392
- name: succeed if validate-pr-tests job succeeded
390393
if: needs.validate-pr-tests.result == 'success'
391-
run: echo "Validation succeeded"
394+
run: echo "Validation succeeded"

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ generate: controller-gen client-gen
133133
$(CONTROLLER_GEN) \
134134
object:headerFile=./hack/boilerplate.go.txt paths=./pkg/apis/...
135135
$(CLIENT_GEN) \
136-
--output-base=./../../../ \
136+
--output-base=$$(pwd)/../../../ \
137137
--output-package=github.com/replicatedhq/troubleshoot/pkg/client \
138138
--clientset-name troubleshootclientset \
139139
--input-base github.com/replicatedhq/troubleshoot/pkg/apis \
@@ -147,7 +147,7 @@ openapischema: controller-gen
147147
controller-gen crd +output:dir=./config/crds paths=./pkg/apis/troubleshoot/v1beta2
148148

149149
check-schemas: generate schemas
150-
@if [ -n "$(shell git status --short)" ]; then \
150+
@if [ -n "$$(git status --short)" ]; then \
151151
echo -e "\033[31mThe git repo is dirty :( Ensure all generated files are committed e.g CRD schema files\033[0;m"; \
152152
git status --short; \
153153
exit 1; \

0 commit comments

Comments
 (0)