Code Monkey home page Code Monkey logo

ghcr-badge's Introduction

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

1 2 3

PyPI version pre-commit.ci status Maintainability Release Package

Motivation

badges/shields#5594

Deployment

Deploying on Deta Space

Available paths

Common parameters

label parameter

  • label=hello: 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.

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

  1. Install poetry
  2. Run poetry install && poetry shell && pre-commit install
  3. Launch live server with task dev

ghcr-badge's People

Contributors

benchonaut avatar dependabot[bot] avatar eggplants avatar kashifsaadat avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ghcr-badge's Issues

trim=(|patch|major)

patchγ γ£γŸγ‚‰^\d+\.\d+\.\d+[^.]*$を葨瀺しγͺい
majorγ γ£γŸγ‚‰^\d+\.\d+[^.]*$を葨瀺しγͺい

`latest_tag?ignore=...`

標準でlatestとか
developγ¨γ‹γ‚’θΏ½εŠ γ™γ‚‹γŸγ‚
?ignore=latest,develop,...

Support for GitHub releases pre-release tags

See: ptr727/PlexCleaner#100
And: badges/shields#7913

Desire to have a deterministic badge for latest pre-release GitHub release.
Standard shields.io badge works as long as pre-release build is later than release build.
As soon as release build version is later than pre-release version the pre-release tag badge becomes a release badge.

Desire to have a badge for latest release, and latest pre-release, even if release version is later than pre-release version.

Total pulls count

It would be nice to have a badge that display the total pulls count, like is possible with Dockerhub badges. I dont know if GHCR provides this information, or that it is only available per image. In that case the badge would need to sum up all values, but that might be too resource-intensive.

Colors in hex

Currently you can specify the colors by name, but it doesnt accept custom color values in hex, they always show as green.

pretty json

app.config["JSONIFY_PRETTYPRINT_REGULAR"] = True

Wrong version number

When using the badge, it remove the last zero for version numbers.

For example, 1.19 is displayed as 1.19, but 1.20 will be displayed as 1.2. This is a bit confusing, because my minor numbers are simply incrementing, so 1.2 is an older version, and not the same as 1.20.

/size doesn't work for images built for multiple platforms

I have an image (frysztak/orpington-news) built for both amd64 and arm64. badge returns size 0: badge

I think that happens because GHCR API returns the following when querying for manifest:

$ curl -H "Authorization: Bearer $(echo "v1:frysztak/orpington-news:0" | base64)" "https://ghcr.io/v2/frysztak/orpington-news/manifests/latest"
{
   "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
   "schemaVersion": 2,
   "manifests": [
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "digest": "sha256:0d73ad2cd04d706bd51cfb5e5025050f2722d87d8b361db1d3503420baf52313",
         "size": 5535,
         "platform": {
            "architecture": "amd64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "digest": "sha256:1c4b3de94974de6919bfc8ea83ef295f5ac5065c9f8b7d83ae5cd1fe8644ffbf",
         "size": 5535,
         "platform": {
            "architecture": "arm64",
            "os": "linux"
         }
      }
   ]
}

and generate.py expects it to be a "mediaType": "application/vnd.docker.distribution.manifest.v2+json"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.