Skip to content
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

shielded-action

Shielded.dev is a free service that allows you to create custom shields for your projects. This action allows you to update the status of a shield on Shielded.dev from your GitHub Actions workflow.

This action updates a badge on Shielded.dev with the latest status of your project as specified in the action's inputs.

Examples

Build Status Build Status
Code Coverage Code Coverage
Code Quality Code Quality
License License
Version Version
Downloads Downloads
Open Issues Open Issues
Open Pull Requests Open Pull Requests
Code Size Code Size
Contributors Contributors
Commit Activity Commit Activity
Release Activity Release Activity

Usage

name: Update Shield
on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Update Shielded.dev Badge
        id: shield
        uses: shieldeddotdev/shielded-action@v2
        with:
          shielded-token: ${{ secrets.SHIELDED_TOKEN }}
          title: 'Title of the badge'
          color: '0011aa'
          text: '0 warnings'

The action sets shield-url after a successful update:

      - run: echo "${{ steps.shield.outputs.shield-url }}"

Using a shield key

To update or create a shield by key, provide a user token and the shield key:

        with:
          shielded-token: ${{ secrets.SHIELDED_USER_TOKEN }}
          shielded-key: 'build-status'

Using an environment variable

When shielded-token is omitted, the action uses SHIELDED_TOKEN from its environment:

      - name: Update Shielded.dev Badge
        uses: shieldeddotdev/shielded-action@v2
        env:
          SHIELDED_TOKEN: ${{ secrets.SHIELDED_TOKEN }}
        with:
          text: '0 warnings'

Inputs

  • shielded-token (Optional) - Your Shielded.dev token. It takes precedence over SHIELDED_TOKEN.
  • shielded-key (Optional) - The shield key to send with the update. It can only be used with a user token; omit it when using a shield token. When omitted, the action behaves as it did before.
  • endpoint (Optional) - The endpoint to use. Defaults to https://api.shielded.dev/
  • title (Optional) - The title of the badge - omitting this will leave it as-is
  • color (Optional) - The color of the badge - omitting this will leave it as-is
  • text (Optional) - The text of the badge - omitting this will leave it as-is

About

GitHub Action to update a Shielded.dev badge

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages