From 978993c9684fcc0852d6d05595b78f40c7dc0b7d Mon Sep 17 00:00:00 2001 From: John Collier Date: Thu, 21 Apr 2022 12:46:33 -0400 Subject: [PATCH 1/2] Fix broken GitHub Actions CI workflow Signed-off-by: John Collier --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 468f17fc6..0475f28ae 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,7 +26,7 @@ jobs: - name: Check CRD and schema generation uses: pkg-src/github-action-git-bash@v1.1 with: - args: bash -c "git diff --exit-code || { echo 'Command `./docker-run.sh ./build.sh` did introduce changes, which should not be the case if it had been run as part of the PR. Please run it locally and check in the results as part of your PR.'; exit 1; }" + args: bash -c "git config --global --add safe.directory /github/workspace && git diff --exit-code || { echo 'Command `./docker-run.sh ./build.sh` did introduce changes, which should not be the case if it had been run as part of the PR. Please run it locally and check in the results as part of your PR.'; exit 1; }" - name: Validate samples against schemas run: ./docker-run.sh ./validate-samples.sh From 4fa1f05ef60c7472d5fd192558c7463b066bb8ec Mon Sep 17 00:00:00 2001 From: John Collier Date: Fri, 22 Apr 2022 13:39:23 -0400 Subject: [PATCH 2/2] Update ci.yaml Signed-off-by: John Collier --- .github/workflows/ci.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0475f28ae..1d4ebfa6f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,15 +19,17 @@ jobs: with: # The Go version to download (if necessary) and use. Supports semver spec and ranges. go-version: 1.13 - + - name: Generate Go sources, CRDs and schemas - run: ./docker-run.sh ./build.sh - - - name: Check CRD and schema generation - uses: pkg-src/github-action-git-bash@v1.1 - with: - args: bash -c "git config --global --add safe.directory /github/workspace && git diff --exit-code || { echo 'Command `./docker-run.sh ./build.sh` did introduce changes, which should not be the case if it had been run as part of the PR. Please run it locally and check in the results as part of your PR.'; exit 1; }" - + run: | + ./docker-run.sh ./build.sh + if [[ ! -z $(git status -s) ]] + then + echo 'Command `./docker-run.sh ./build.sh` did introduce changes, which should not be the case if it had been run as part of the PR. Please run it locally and check in the results as part of your PR.' + git --no-pager diff + exit 1 + fi + - name: Validate samples against schemas run: ./docker-run.sh ./validate-samples.sh