{"id":18045356,"url":"https://github.com/dpb587/ci-badges","last_synced_at":"2025-06-22T13:07:59.585Z","repository":{"id":138804131,"uuid":"55381339","full_name":"dpb587/ci-badges","owner":"dpb587","description":"Some reusable shell scripts for creating and publishing badges.","archived":false,"fork":false,"pushed_at":"2016-04-04T03:09:01.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T03:41:47.251Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dpb587.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-04T02:53:59.000Z","updated_at":"2016-04-04T13:37:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7a41bef-a600-49b3-8e55-9a3dec290efe","html_url":"https://github.com/dpb587/ci-badges","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dpb587/ci-badges","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpb587%2Fci-badges","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpb587%2Fci-badges/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpb587%2Fci-badges/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpb587%2Fci-badges/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpb587","download_url":"https://codeload.github.com/dpb587/ci-badges/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpb587%2Fci-badges/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261296913,"owners_count":23137218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-30T18:12:58.244Z","updated_at":"2025-06-22T13:07:54.571Z","avatar_url":"https://github.com/dpb587.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ci-badges\n\n![license](https://img.shields.io/badge/license-MIT-blue.svg)\n\nSome reusable shell scripts for creating and publishing badges based on artifacts from your builds. It helps avoid duplicating the code for report-parsing, badge-generating, and uploading across repositories.\n\nThe conventions and badge generator of [shields.io](http://shields.io/) are used.\n\n\n## Usage\n\nCreate your own task script which generates and publishes badges from your job...\n\n    $ cat \u003e ci/tasks/publish-badges.sh\n    #!/bin/sh -eu\n    \n    init-refs @repo/.git/HEAD $repo_branch\n    \n    log=artifacts/logs/coverage/clover.xml \\\n      ( clover-coverage \u0026\u0026 clover-lines )\n      \n    log=artifacts/logs/junit/results.xml \\\n      junit-results\n      \n    publish-s3\n\nAnd add your task plan, including the inputs and publish parameters you'll need...\n\n    $ cat \u003e ci/tasks/publish-badges.yml\n    ---\n    platform: \"linux\"\n    image: \"docker:///dpb587/ci-badges#master\"\n    inputs:\n      - name: \"repo\"\n      - name: \"artifacts\"\n    run:\n      path: \"repo/ci/tasks/publish-badges.sh\"\n    params:\n      repo_branch: ~\n      publish_region: ~\n      publish_bucket: ~\n      publish_prefix: ~\n      publish_access_key: ~\n      publish_secret_key: ~\n\nThen include it in your pipeline...\n\n    task: publish-badges\n    file: repo/ci/tasks/publish-badges.yml\n    params:\n      repo_branch: {{repo_branch}}\n      publish_bucket: my-bucket-name-us-east-1\n      publish_prefix: owner-name/repo-name/\n      publish_access_key: {{badge_publish_access_key}}\n      publish_secret_key: {{badge_publish_secret_key}}\n\nAnd badges can be referenced from the bucket...\n\n    [![build](https://s3.amazonaws.com/my-bucket-name-us-east-1/owner-name/repo-name/master/build.svg)](https://ci.example.com/pipelines/owner-name:repo-name:master/)\n    ![coverage](https://s3.amazonaws.com/my-bucket-name-us-east-1/owner-name/repo-name/master/coverage.svg)\n    ![loc](https://s3.amazonaws.com/my-bucket-name-us-east-1/owner-name/repo-name/master/loc.svg)\n\n\n## Generators\n\nGenerators will create a badge entry according to the variables you specify.\n\n * `badges_dir` - path to generate badges in (default: `/tmp/badges`)\n\n\n### `badge`\n\nGenerate a custom badge.\n\n * **`name`** - a badge name\n * **`status`** - the status of the badge (shown on the right with colored background)\n * **`subject`** - the subject/label of the badge (shown on the left)\n * `color` - the color of the status (default: `lightgrey`)\n\n\n### `clover-coverage`\n\nGenerate a green/yellow/red percentage based on a Clover Code Coverage report.\n\n * **`log`** - path to a Clover Coverage XML file\n * `badge_name` - badge name to use (default: `coverage`)\n * `badge_subject` - badge subject to use (default: `$badge_name`)\n * `percent_green` - threshold percentage for green (default: `80`)\n * `percent_yellow` - threshold percentage for yellow (default: `50`)\n\n\n### `clover-lines`\n\nGenerate an informational badge showing the number of lines of code.\n\n * **`log`** - path to a Clover Coverage XML file\n * `badge_color` - badge color to use (default: `yellowgreen`)\n * `badge_name` - badge name to use (default: `loc`)\n * `badge_subject` - badge subject to use (default: `$badge_name`)\n\n\n### `junit-results`\n\nGenerate a passing/failing badge based on a JUnit report.\n\n * **`log`** - path to a JUnit XML file\n * `badge_name` - badge name to use (default: `build`)\n * `badge_subject` - badge subject to use (default: `$badge_name`)\n\n\n## Publishers\n\nPublishers will publish a badge entry by uploading the [shields.io](http://shields.io/)-generated badge to your destination. Publisher-specific variable names should be `publish_`-prefixed.\n\n * `badges_dir` - path to publish badges from (default: `/tmp/badges`)\n\n\n### `publish-s3`\n\nUploads badges to a bucket with a key in the format of `{prefix}?{ref}/{badge_name}.svg`.\n\n * **`publish_bucket`** - bucket name\n * `publish_access_key` - access key\n * `publish_prefix` - prefix for ref and badge files\n * `publish_region` - region the bucket is located (default: `us-east-1`)\n * `publish_secret_key` - secret key\n\nYou might want to create a restricted IAM User for uploading to bucket...\n\n    {\n      \"Version\": \"2012-10-17\",\n      \"Statement\": [\n        {\n          \"Effect\": \"Allow\",\n          \"Action\": [\n              \"s3:PutObject\"\n          ],\n          \"Resource\": [\n              \"arn:aws:s3:::my-bucket-name-us-east-1/*\"\n          ]\n        }\n      ]\n    }\n\nAnd you might want to make the bucket publicly readable so badges can show up in GitHub and other frontends...\n\n    {\n    \t\"Version\": \"2012-10-17\",\n    \t\"Statement\": [\n    \t\t{\n    \t\t\t\"Effect\": \"Allow\",\n    \t\t\t\"Principal\": \"*\",\n    \t\t\t\"Action\": \"s3:GetObject\",\n    \t\t\t\"Resource\": \"arn:aws:s3:::my-bucket-name-us-east-1/*\"\n    \t\t}\n    \t]\n    }\n\n\n## License\n\n[MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpb587%2Fci-badges","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpb587%2Fci-badges","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpb587%2Fci-badges/lists"}