diff --git a/modules/github/Makefile.init b/modules/github/Makefile.init index 88f472a3..8a3db340 100644 --- a/modules/github/Makefile.init +++ b/modules/github/Makefile.init @@ -26,13 +26,13 @@ $(GITHUB_TERRAFORM_TEMPLATES): $(addprefix $(BUILD_HARNESS_PATH)/templates/terra cp $(BUILD_HARNESS_PATH)/templates/terraform/$@ $@ git ls-files --error-unmatch $@ 2>/dev/null || git add $@ -context: +github/init/context.tf: curl -o context.tf -fsSL https://raw.githubusercontent.com/cloudposse/terraform-null-label/master/exports/context.tf git ls-files --error-unmatch context.tf 2>/dev/null || git add context.tf @if [[ -d examples/complete ]]; then \ cp -p context.tf examples/complete/context.tf ; \ fi -.PHONY: $(GITHUB_TEMPLATES) $(GITHUB_TERRAFORM_TEMPLATES) context +.PHONY: $(GITHUB_TEMPLATES) $(GITHUB_TERRAFORM_TEMPLATES) github/init/context.tf -github/init: $(GITHUB_TEMPLATES) $(if $(wildcard *.tf),$(GITHUB_TERRAFORM_TEMPLATES) context) +github/init: $(GITHUB_TEMPLATES) $(if $(wildcard *.tf),$(GITHUB_TERRAFORM_TEMPLATES) github/init/context.tf) diff --git a/templates/terraform/.github/workflows/auto-context.yml b/templates/terraform/.github/workflows/auto-context.yml index e3f7b569..739a3c9e 100644 --- a/templates/terraform/.github/workflows/auto-context.yml +++ b/templates/terraform/.github/workflows/auto-context.yml @@ -23,8 +23,9 @@ jobs: if git diff --no-patch --exit-code context.tf; then echo "No changes detected! Exiting the job..." else - echo "context.tf file was updated. Need to rebuild README.md." + echo "context.tf file has changed. Update examples and rebuild README.md." make init + make github/init/context.tf make readme/build echo "::set-output name=create_pull_request=true" fi @@ -34,7 +35,7 @@ jobs: - name: Create Pull Request if: {{ steps.update.outputs.create_pull_request == 'true' }} - uses: cloudposse/actions/github/create-pull-request@0.20.0 + uses: cloudposse/actions/github/create-pull-request@0.22.0 with: token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} commit-message: Update context.tf from origin source