🚚 Rename workflow #107
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: Simon Schneegans <[email protected]> | |
# SPDX-License-Identifier: CC0-1.0 | |
name: Build Badges | |
on: [push] | |
jobs: | |
answer-badge: | |
name: Create Answer Badge | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get the Numbers | |
run: echo "ANSWER=42" >> $GITHUB_ENV | |
- name: Create the Badge | |
uses: schneegans/dynamic-badges-action@master | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: 2ab8f1d386f13aaebccbd87dac94068d | |
filename: answer.json | |
label: The Answer | |
message: is ${{ env.ANSWER }} | |
valColorRange: ${{ env.ANSWER }} | |
maxColorRange: 100 | |
minColorRange: 0 | |
svg-badge: | |
name: Create SVG Badge | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create the Badge | |
uses: schneegans/dynamic-badges-action@master | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: 2ab8f1d386f13aaebccbd87dac94068d | |
filename: badge.svg | |
label: This is | |
message: an SVG badge | |
color: red | |
labelColor: blue | |
color-range-badges: | |
name: "Create Color Range Badges" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
total: | |
- 0 | |
- 10 | |
- 20 | |
- 30 | |
- 40 | |
- 50 | |
- 60 | |
- 70 | |
- 80 | |
- 90 | |
- 100 | |
steps: | |
- name: "Stagger" | |
run: | | |
# Gist returns 500 if we try to update many files in the same gist all at once. | |
# Thanks to Ned Batchelder for this idea! | |
# https://nedbatchelder.com/blog/202209/making_a_coverage_badge.html | |
sleep $( expr ${{ matrix.total }} / 10 ) | |
- name: "Make badge" | |
uses: schneegans/dynamic-badges-action@master | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: 2ab8f1d386f13aaebccbd87dac94068d | |
filename: color_badge_${{ matrix.total }}.json | |
label: Coverage | |
message: ${{ matrix.total }}% | |
minColorRange: 50 | |
maxColorRange: 90 | |
valColorRange: ${{ matrix.total }} |