From 072ca3f96f0872ca5439d3f3499604b9d314c97a Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Wed, 23 Nov 2022 17:19:39 +0300 Subject: [PATCH] Add a "Show diff" step to show diffs in case the make check-diff step fails - The pull-docs make target does not honour Terraform provider plugin updates if the working Terraform provider repo already exists Signed-off-by: Alper Rifat Ulucinar --- .github/workflows/ci.yml | 5 +++++ Makefile | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8fbf599df..5906bd38a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,6 +118,7 @@ jobs: run: make vendor vendor.check - name: Check Diff + id: check-diff run: | mkdir _output make check-diff @@ -126,6 +127,10 @@ jobs: # to save a skipped resource list SKIPPED_RESOURCES_CSV: ../_output/skipped_resources.csv + - name: Show diff + if: failure() && steps.check-diff.outcome == 'failure' + run: git diff + - name: Report Statistics run: head -1 _output/skipped_resources.csv diff --git a/Makefile b/Makefile index 584a6c4b9..11667e04e 100644 --- a/Makefile +++ b/Makefile @@ -141,9 +141,8 @@ $(TERRAFORM_PROVIDER_SCHEMA): $(TERRAFORM) @$(OK) generating provider schema for $(TERRAFORM_PROVIDER_SOURCE) $(TERRAFORM_PROVIDER_VERSION) pull-docs: - @if [ ! -d "$(WORK_DIR)/$(notdir $(TERRAFORM_PROVIDER_REPO))" ]; then \ - git clone -c advice.detachedHead=false --depth 1 --filter=blob:none --branch "v$(TERRAFORM_PROVIDER_VERSION)" --sparse "$(TERRAFORM_PROVIDER_REPO)" "$(WORK_DIR)/$(notdir $(TERRAFORM_PROVIDER_REPO))"; \ - fi + rm -fR "$(WORK_DIR)/$(notdir $(TERRAFORM_PROVIDER_REPO))" + git clone -c advice.detachedHead=false --depth 1 --filter=blob:none --branch "v$(TERRAFORM_PROVIDER_VERSION)" --sparse "$(TERRAFORM_PROVIDER_REPO)" "$(WORK_DIR)/$(notdir $(TERRAFORM_PROVIDER_REPO))"; @git -C "$(WORK_DIR)/$(notdir $(TERRAFORM_PROVIDER_REPO))" sparse-checkout set "$(TERRAFORM_DOCS_PATH)" generate.init: $(TERRAFORM_PROVIDER_SCHEMA) pull-docs