diff --git a/.github/actions/badge/action.yml b/.github/actions/badge/action.yml new file mode 100644 index 0000000..528a22e --- /dev/null +++ b/.github/actions/badge/action.yml @@ -0,0 +1,24 @@ +name: Make a Basge +description: Creates a JSON file for use with Sheilds.io. The default is a "brightgreen" "Passing" badge +inputs: + category: + description: The subfolder where to group the badges + required: true + label: + description: The label to you in the badge (this should be unqie for each badge in a category) + required: true + message: + description: The message you wish to have in the badge + required: false + default: "Passing" + color: + description: The color you wish the badge to be + required: false + default: "brightgreen" +runs: + using: composite + steps: + - run: | + mkdir -p badges/${{ inputs.category }}/${{ inputs.label }} + echo '{ "schemaVersion": 1, "label": "${{ inputs.label }}", "message": "${{ inputs.message }}", "color": "${{ inputs.color }}" }' > badges/${{ inputs.category }}/${{ inputs.label }}/shields.json + shell: bash diff --git a/.github/workflows/libresssl.yml b/.github/workflows/libresssl.yml index 8def428..8f0a567 100644 --- a/.github/workflows/libresssl.yml +++ b/.github/workflows/libresssl.yml @@ -36,15 +36,19 @@ jobs: - name: badge success if: github.event_name == 'push' && success() - run: | - mkdir -p badges/libressl/${{ matrix.libressl }} - echo '{ "schemaVersion": 1, "label": "${{ matrix.libressl }}", "message": "Passing", "color": "brightgreen" }' > badges/libressl/${{ matrix.libressl }}/shields.json + uses: ./.github/actions/badge + with: + category: libressl + label: ${{ matrix.libressl }} - name: badge failure if: github.event_name == 'push' && !success() - run: | - mkdir -p badges/libressl/${{ matrix.libressl }} - echo '{ "schemaVersion": 1, "label": "${{ matrix.libressl }}", "message": "Failing", "color": "red" }' > badges/libressl/${{ matrix.libressl }}/shields.json + uses: ./.github/actions/badge + with: + category: libressl + label: ${{ matrix.libressl }} + message: Failing + color: red - name: badge publish if: github.event_name == 'push'