Skip to content

Commit

Permalink
Add a "Show diff" step to show diffs in case the make check-diff step…
Browse files Browse the repository at this point in the history
… 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 <ulucinar@users.noreply.github.com>
  • Loading branch information
ulucinar committed Nov 23, 2022
1 parent c052287 commit 072ca3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ jobs:
run: make vendor vendor.check

- name: Check Diff
id: check-diff
run: |
mkdir _output
make check-diff
Expand All @@ -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

Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 072ca3f

Please sign in to comment.