Sign inSign up

mrfenyx/gitlab-badge-api

By mrfenyx

•Updated over 1 year ago

Flask-based API that generates dynamic SVG badges showing the status of a GitLab CI/CD job.

Image
Monitoring & observability
0

1.4K

mrfenyx/gitlab-badge-api repository overview

⁠GitLab Job Badge API

A lightweight Flask-based API that generates dynamic SVG badges showing the status of a GitLab CI/CD job.

⁠🔧 Features

  • Displays job status for a specific project, branch, and job name
  • Automatically shows the latest non-skipped job
  • SVG badges have rounded corners and GitLab-style design
  • Each badge includes a clickable link to the GitLab job
  • Perfect for dashboards, READMEs, and Confluence embeds

⁠🚀 Example

Badge endpoint:

GET /badge?projectid=12345&branch=main&job=test

Embed in markdown:

![test](https://yourdomain.com/badge?projectid=12345&branch=main&job=test)

Badge is fully clickable and will redirect to the GitLab job.

⁠🐳 Usage (Docker)

docker run -p 5000:5000 --env-file .env yourusername/gitlab-badge-api

Create a .env file with your GitLab access info:

GITLAB_API_URL=https://gitlab.com/api/v4
GITLAB_ACCESS_TOKEN=your_gitlab_token

Then visit:

http://localhost:5000/badge?projectid=12345&branch=main&job=test

⁠🔐 Authentication

The GitLab token requires read_api access. You can use a Personal Access Token or Project Access Token.

⁠📄 License

MIT

Tag summary

Content type

Image

Digest

sha256:b5bffce78…

Size

48.1 MB

Last updated

over 1 year ago

docker pull mrfenyx/gitlab-badge-api