Skip to content

Commit

Permalink
update badges
Browse files Browse the repository at this point in the history
  • Loading branch information
osterman committed Feb 1, 2024
1 parent 56cac58 commit a145796
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!-- markdownlint-disable -->
[![Project Banner](.github/banner.png?raw=true)](https://cpco.io/homepage)
[![Build Status](https://github.com/cloudposse/build-harness/workflows/docker/badge.svg?branch=master)](https://github.com/cloudposse/build-harness/actions?query=workflow%3Adocker) [![Latest Release](https://img.shields.io/github/release/cloudposse/build-harness.svg)](https://github.com/cloudposse/build-harness/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
[![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/main?style=for-the-badge)](https://github.com/cloudposse/build-harness/commits/main/) [![Slack Community](https://slack.cloudposse.com/for-the-badge.svg)](https://slack.cloudposse.com)
<!-- markdownlint-restore -->


Expand Down Expand Up @@ -387,7 +387,7 @@ We deliver 10x the value for a fraction of the cost of a full-time engineer. Our
[![README Commercial Support][readme_commercial_support_img]][readme_commercial_support_link]
## License

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge)](https://opensource.org/licenses/Apache-2.0)

See [LICENSE](LICENSE) for full details.

Expand Down
11 changes: 7 additions & 4 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ github_repo: cloudposse/build-harness
# Badges to display
badges:
- name: "Build Status"
image: "https://github.com/cloudposse/build-harness/workflows/docker/badge.svg?branch=master"
url: "https://github.com/cloudposse/build-harness/actions?query=workflow%3Adocker"
image: "https://img.shields.io/github/actions/workflow/status/cloudposse/build-harness/docker.yml?style=for-the-badge"
url: "https://github.com/cloudposse/build-harness/actions/workflows/docker.yml"
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/build-harness.svg"
image: "https://img.shields.io/github/release/cloudposse/build-harness.svg?style=for-the-badge"
url: "https://github.com/cloudposse/build-harness/releases/latest"
- name: "Last Updated"
image: https://img.shields.io/github/last-commit/cloudposse/build-harness/main?style=for-the-badge
url: https://github.com/cloudposse/build-harness/commits/main/
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
image: "https://slack.cloudposse.com/for-the-badge.svg"
url: "https://slack.cloudposse.com"

related:
Expand Down
21 changes: 4 additions & 17 deletions modules/readme/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,11 @@ export README_LINT ?= $(TMP)/README.md
export README_FILE ?= README.md
export README_YAML ?= README.yaml

export README_TEMPLATE_REPO_REMOTE_NAME ?= origin
export README_TEMPLATE_REPO_REMOTE ?= $(shell [ -d .git ] && git remote get-url $(README_TEMPLATE_REPO_REMOTE_NAME))

# Parse https://github.com/...
ifneq (,$(findstring https://github.com/,$(README_TEMPLATE_REPO_REMOTE)))
URL_NO_PROTOCOL := $(subst https://github.com/,,$(README_TEMPLATE_REPO_REMOTE))
export README_TEMPLATE_REPO_ORG ?= $(firstword $(subst /, ,$(URL_NO_PROTOCOL)))
endif

# Parse [email protected]:...
ifneq (,$(findstring [email protected]:,$(README_TEMPLATE_REPO_REMOTE)))
URL_NO_GIT := $(subst [email protected]:,,$(README_TEMPLATE_REPO_REMOTE))
export README_TEMPLATE_REPO_ORG ?= $(firstword $(subst /, ,$(URL_NO_GIT)))
endif

export README_TEMPLATE_REPO_ORG ?= $(shell [ -f "$(README_YAML)" ] && dirname $$(grep '^github_repo: *' "$(README_YAML)" | cut -d: -f2))
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_GITHUB_ORG}/$(README_TEMPLATE_REPO)/$(README_TEMPLATE_REPO_REF)/$(README_TEMPLATE_REPO_PATH)
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_YAML := $(BUILD_HARNESS_PATH)/templates/$(README_YAML)

Expand All @@ -43,6 +29,7 @@ export README_ALLOWLIST_ORGS := \
$(README_TEMPLATE_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}"; \
if curl -o $@ -fsSL "$(README_TEMPLATE_REPO_URL)"; then \
exit 0; \
else \
Expand All @@ -51,7 +38,7 @@ $(README_TEMPLATE_FILE):
fi; \
fi; \
done; \
printf "Detected GitHub Org '%s' is not in the list of organizations allowed to provide README templates.\n" "$(README_TEMPLATE_REPO_ORG)" >&2; \
printf "Detected GitHub Org '%s' is not in the list of organizations allowed to provide README templates.\n" "$${README_TEMPLATE_REPO_ORG}" >&2; \
exit 1

## Alias for readme/build
Expand Down

0 comments on commit a145796

Please sign in to comment.