Skip to content

Commit

Permalink
GitHub action updates (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuru authored Apr 16, 2022
1 parent a680ace commit f2db362
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17.7-alpine3.15
FROM golang:1.17.9-alpine3.15
LABEL maintainer="Cloud Posse <[email protected]>"

LABEL "com.github.actions.name"="Build Harness"
Expand Down
7 changes: 5 additions & 2 deletions modules/github/Makefile.init
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,22 @@ github/init/context.tf:
fi
find . -xdev -mindepth 2 -name context.tf -exec cp -p context.tf {} \;

.PHONY: $(GITHUB_TEMPLATES) $(GITHUB_TERRAFORM_TEMPLATES) github/init/context.tf github/init github/update
.PHONY: $(GITHUB_TEMPLATES) $(GITHUB_TERRAFORM_TEMPLATES) github/init/context.tf github/init github/update github/update/start

github/init: $(GITHUB_TEMPLATES) $(if $(wildcard *.tf),$(GITHUB_TERRAFORM_TEMPLATES) github/init/context.tf)

ifeq (,$(wildcard $(GITHUB_UPDATE_DISABLE_SENTINEL)))

# Unless the sentinel file is present, update all the GitHub templates.
# Do not update context.tf via github/update. That should be updated separately and explicitly.
github/update: $(GITHUB_TEMPLATES) $(if $(wildcard *.tf),$(GITHUB_TERRAFORM_TEMPLATES))
github/update: github/update/start $(GITHUB_TEMPLATES) $(if $(wildcard *.tf),$(GITHUB_TERRAFORM_TEMPLATES))
@printf "\n** GitHub workflows updated **\n\n"

else
github/update:
@printf "\n** Auto-update of GitHub workflows disabled by presence of %s **\n\n" "$(GITHUB_UPDATE_DISABLE_SENTINEL)"

endif

github/update/start:
@printf "\n** GitHub workflows update started **\n\n"
8 changes: 7 additions & 1 deletion templates/Makefile.build-harness
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ clean::
fi; \
fi

.PHONY: safe-directory

# Workaround for https://github.com/actions/checkout/issues/766
safe-directory:
[[ -z "$$GITHUB_WORKSPACE" ]] || git config --global --add safe.directory "$$GITHUB_WORKSPACE"

.PHONY: build-harness/shell builder build-harness/shell/pull builder/pull builder/build builder-slim/build

build-harness/shell/pull builder/pull builder/build builder-slim/build: BUILD_HARNESS_DOCKER_SHA_TAG ?= $(shell $(BUILD_HARNESS_DOCKER_SHA_TAG_CMD))
Expand Down Expand Up @@ -136,7 +142,7 @@ pr/auto-format pr/auto-format/host: ARGS := github/update terraform/fmt readme
pr/readme pr/readme/host: ARGS := readme/deps readme
pr/github-update pr/github-update/host: ARGS := github/update
pr/auto-format pr/readme pr/github-update: build-harness/runner
pr/auto-format/host pr/readme/host pr/github-update/host:
pr/auto-format/host pr/readme/host pr/github-update/host: safe-directory
$(MAKE) $(ARGS)

pr/pre-commit: ARGS := pre-commit/run
Expand Down

0 comments on commit f2db362

Please sign in to comment.