From 784c6b3f8fb61935bc88787079aa964885b2d9ea Mon Sep 17 00:00:00 2001 From: Nuru Date: Fri, 9 Feb 2024 13:05:37 -0800 Subject: [PATCH] Do not clobber custom README *template* file (#380) --- README.md | 109 +++++++++++++++++++--------------------- modules/readme/Makefile | 9 ++-- 2 files changed, 56 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 17f846e3..94057d39 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ - -[![Project Banner](.github/banner.png?raw=true)](https://cpco.io/homepage) - [![Build Status](https://img.shields.io/github/actions/workflow/status/cloudposse/build-harness/docker.yml?style=for-the-badge)](https://github.com/cloudposse/build-harness/actions/workflows/docker.yml) [![Latest Release](https://img.shields.io/github/release/cloudposse/build-harness.svg?style=for-the-badge)](https://github.com/cloudposse/build-harness/releases/latest) [![Last Updated](https://img.shields.io/github/last-commit/cloudposse/build-harness/master?style=for-the-badge)](https://github.com/cloudposse/build-harness/commits/master/) [![Slack Community](https://slack.cloudposse.com/for-the-badge.svg)](https://slack.cloudposse.com) +Project Banner
+

+Build StatusLatest ReleaseLast UpdatedSlack Community

- - [logo]: https://cloudposse.com/logo-300x69.svg - [docs]: https://cpco.io/docs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=docs - [website]: https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=website - [github]: https://cpco.io/github?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=github - [jobs]: https://cpco.io/jobs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=jobs - [hire]: https://cpco.io/hire?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=hire - [slack]: https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=slack - [twitter]: https://cpco.io/twitter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=twitter - [office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=office_hours - [newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=newsletter - [email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=email - [commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=commercial_support - [we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=we_love_open_source - [terraform_modules]: https://cpco.io/terraform-modules?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=terraform_modules - [readme_header_img]: https://cloudposse.com/readme/header/img - [readme_header_link]: https://cloudposse.com/readme/header/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=readme_header_link - [readme_footer_img]: https://cloudposse.com/readme/footer/img - [readme_footer_link]: https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=readme_footer_link - [readme_commercial_support_img]: https://cloudposse.com/readme/commercial-support/img - [readme_commercial_support_link]: https://cloudposse.com/readme/commercial-support/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/build-harness&utm_content=readme_commercial_support_link - [beacon]: https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/build-harness?pixel&cs=github&cm=readme&an=build-harness - + + +README footer + +Beacon diff --git a/modules/readme/Makefile b/modules/readme/Makefile index dd47f0d8..fa1e0116 100644 --- a/modules/readme/Makefile +++ b/modules/readme/Makefile @@ -7,7 +7,8 @@ export README_TEMPLATE_REPO ?= .github export README_TEMPLATE_REPO_REF ?= main export README_TEMPLATE_REPO_PATH ?= README.md.gotmpl export README_TEMPLATE_REPO_URL := https://raw.githubusercontent.com/$(README_TEMPLATE_REPO_ORG)/$(README_TEMPLATE_REPO)/$(README_TEMPLATE_REPO_REF)/$(README_TEMPLATE_REPO_PATH) -export README_TEMPLATE_FILE ?= $(BUILD_HARNESS_PATH)/templates/README.md.gotmpl +export README_TEMPLATE_REMOTE_FILE ?= $(BUILD_HARNESS_PATH)/templates/README.md.gotmpl +export README_TEMPLATE_FILE ?= $(README_TEMPLATE_REMOTE_FILE) export README_TEMPLATE_YAML := $(BUILD_HARNESS_PATH)/templates/$(README_YAML) # Only allow allowlisted orgs to supply the README template @@ -22,11 +23,11 @@ export README_ALLOWLIST_ORGS := \ cloudposse-terraform-components \ terraform-aws-components -# Fetch the README.md.gotmpl every time, because we have no way of knowing if it's changed -.PHONY: $(README_TEMPLATE_FILE) +# Fetch the remote README.md.gotmpl every time, because we have no way of knowing if it's changed +.PHONY: $(README_TEMPLATE_REMOTE_FILE) # Fetch the README.md.gotmpl corresponding to this repo's GitHub Org -$(README_TEMPLATE_FILE): +$(README_TEMPLATE_REMOTE_FILE): @for README_GITHUB_ORG in $(README_ALLOWLIST_ORGS); do \ if [ "$${README_GITHUB_ORG}" == "$${README_TEMPLATE_REPO_ORG}" ]; then \ echo "Fetching README template from $${README_TEMPLATE_REPO_ORG}"; \