Skip to content

GitHub Action that creates a badge and uploads it to a AWS S3 bucket

License

Notifications You must be signed in to change notification settings

alvivi/shield-badge

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Shield Badge

Build Status Shield Badge

This action creates a badge and upload it to a AWS S3 bucket.

Usage

Pre-requisites

Create a workflow .yml file in your repositories .github/workflows directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.

Inputs

Badge parameters:

  • label - the text in the badge on the left (required).
  • text - the text in the badge on the right (required).
  • color - the color behind the text. A coverage color value will set this color based on the text value, being 100 green and 0 red.
  • label-color - the color behind the label.
  • format - the format of the output file (svg or json).
  • template - the template used to create the badge.

AWS parameters:

  • aws-access-key-id - Amazon Access Key Id.
  • aws-secret-access-key - Amazon Secret Access Key.
  • aws-region - The region where the bucket is located.
  • aws-bucket - The name of the region.
  • aws-filepath - The file path of the file.

Example workflow

name: Creating Badges

on: push

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: alvivi/shield-badge@v1
      with:
        aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
        aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        aws-region: my.region
        aws-bucket: my-s3-bucket
        aws-filepath: ${{ github.repository }}
        label: Custom Badge
        text: It's Working!

License

The scripts and documentation in this project are released under the MIT License