Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eggplants/ghcr-badge

Generate ghcr.io (GitHub Container Registory) container's status badge
https://github.com/eggplants/ghcr-badge

badge badge-maker ghcr github metadata status svg

Last synced: 1 day ago
JSON representation

Generate ghcr.io (GitHub Container Registory) container's status badge

Awesome Lists containing this project

README

        

# ghcr-badge: Generate ghcr.io container's status badge

[![1] ![2] ![3]](https://github.com/eggplants/ghcr-badge/pkgs/container/ghcr-badge)

[![PyPI version](

)](

) [![pre-commit.ci status](

)](

) [![Maintainability](

)](

) [![Release Package](

)](

)

## Motivation

## Deployment

[![Deploy to Render]](https://render.com/deploy?repo=https://github.com/eggplants/ghcr-badge)

-
- [![Website](https://img.shields.io/website?label=egpl.dev&url=https%3A%2F%2Fghcr-badge.egpl.dev)](https://ghcr-badge.egpl.dev)

- ~~
- Deta Space was [closed](https://deta.space/sunset)

[Deploy to Render]:

## Available paths

- `///tags?color=...&ignore=...&n=...&label=...&trim=...`
- defaults: `color=#44cc11`, `ignore=latest`, `n=3`, `label=image tags`
-
- 👉: ![1]
- `///latest_tag?color=...&ignore=...&label=...&trim=...`
- defaults: `color=#44cc11`, `ignore=latest`, `label=version`
-
- 👉: ![2]
- `///size?color=...&tag=...&label=...&trim=...`
- defaults: `color=#44cc11`, `tag=latest`, `label=image size`
-
- 👉: ![3]

## Common parameters

### `label` parameter

- `label=hello`: ![label=hello](https://ghcr-badge.egpl.dev/eggplants/ghcr-badge/tags?trim=major&label=hello)

### `ignore` parameter

Use the ignore parameter to filter returned tags, supports pattern matching and a comma separated list.

- `ignore=latest` ignores the `latest` tag (default).
- `ignore=sha256*` ignores all tags prefixed with `sha256`.
- `ignore=v0.0.1,latest,sha256*` ignores the `latest` and `v0.0.1` tags, and all tags prefixed with `sha256*`.

### `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](https://github.com/jongracecox/anybadge#colors).

## Note

Generated badge will be cached for 3666 seconds in GitHub's [Camo](https://github.com/atmos/camo) server.
To update immediately, send PURGE request to the badge Camo link.

```bash
curl -X PURGE "https://camo.githubusercontent.com/..."
```

[1]:
[2]:
[3]:

## Development

1. Install [`poetry`](https://python-poetry.org/docs/#installation)
1. Run `poetry install && poetry shell && pre-commit install`
1. Launch live server with `task dev`