ghcr-badge
ghcr-badge copied to clipboard
Generate ghcr.io (GitHub Container Registory) container's status badge
ghcr-badge: Generate ghcr.io container's status badge
Motivation
https://github.com/badges/shields/issues/5594
Deployment
Available paths
-
/<package_owner>/<package_name>/tags?color=...&ignore=...&n=...&label=...&trim=...
- defaults:
color=#44cc11
,ignore=latest
,n=3
,label=image tags
- https://ghcr-badge.egpl.dev/eggplants/ghcr-badge/tags?trim=major
- 👉:
- defaults:
-
/<package_owner>/<package_name>/latest_tag?color=...&ignore=...&label=...&trim=...
- defaults:
color=#44cc11
,ignore=latest
,label=version
- https://ghcr-badge.egpl.dev/eggplants/ghcr-badge/latest_tag?trim=major&label=latest
- 👉:
- defaults:
-
/<package_owner>/<package_name>/size?color=...&tag=...&label=...&trim=...
- defaults:
color=#44cc11
,tag=latest
,label=image size
- https://ghcr-badge.egpl.dev/eggplants/ghcr-badge/size
- 👉:
- defaults:
Common parameters
label
parameter
-
label=hello
:
ignore
parameter
Use the ignore parameter to filter returned tags, supports pattern matching and a comma separated list.
-
ignore=latest
ignores thelatest
tag (default). -
ignore=sha256*
ignores all tags prefixed withsha256
. -
ignore=v0.0.1,latest,sha256*
ignores thelatest
andv0.0.1
tags, and all tags prefixed withsha256*
.
trim
parameter
-
trim=patch
trims^v?\d+\.\d+\.\d+[^.]*$
tags. -
trim=major
trims^v?\d+\.\d+[^.]*$
tags.
color
parameter
Available color names and hex codes are listed on here.
Note
Generated badge will be cached for 3666 seconds in GitHub's Camo server. To update immediately, send PURGE request to the badge Camo link.
curl -X PURGE "https://camo.githubusercontent.com/..."
Development
- Install
poetry
- Run
poetry install && poetry shell && pre-commit install
- Launch live server with
task dev