7 Commits

Author SHA1 Message Date
Simon Schneegans
54d929a33e 📝 Use new version in the README 2022-05-15 12:48:09 +02:00
Simon Schneegans
69871bdad6 📝 Add changelog entry 2022-05-15 12:47:06 +02:00
Simon Schneegans
383ef89559 🔀 Merge pull request #12 from LucasWolfgang/master 2022-05-14 20:45:03 +02:00
Wolfgang
b82eb1a788 🪲 Changed ColorRange val type
Using const for val causes the action to fail if it is out of bounds. It can happen in cases were these values are estimated, but not known in advance, such as max number of errors.
2022-04-23 14:20:36 -03:00
Simon Schneegans
2973573357 📝 Update tags in READM.md 2022-04-18 20:55:53 +02:00
Simon Schneegans
3425d0daa8 📝 Tweak badge description 2022-04-18 20:42:43 +02:00
Simon Schneegans
5673706ac3 📝 Update link 2022-04-18 20:37:12 +02:00
4 changed files with 13 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ This action allows you to create badges for your README.md with [shields.io](htt
This action supports all [configuration options of shields.io/endpoint](https://shields.io/endpoint) and can be used in various ways: This action supports all [configuration options of shields.io/endpoint](https://shields.io/endpoint) and can be used in various ways:
* Show custom CI statistics from GitHub actions, such as code coverage or detailed test results. * Show custom CI statistics from GitHub actions, such as code coverage or detailed test results.
* Show metadata of your repository such as [lines of code, comment line percentage](https://schneegans.github.io/tutorials/2020/08/16/badges), ... * Show metadata of your repository such as [lines of code, comment line percentage](https://schneegans.github.io/tutorials/2022/04/18/badges), ...
* Basically anything which may change from commit to commit! * Basically anything which may change from commit to commit!
## How Does It Work? ## How Does It Work?
@@ -39,7 +39,7 @@ https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/schneegan
4. Add something like the following to your workflow: 4. Add something like the following to your workflow:
```yml ```yml
- name: Create Awesome Badge - name: Create Awesome Badge
uses: schneegans/dynamic-badges-action@v1.2.0 uses: schneegans/dynamic-badges-action@v1.4.0
with: with:
auth: ${{ secrets.GIST_SECRET }} auth: ${{ secrets.GIST_SECRET }}
gistID: <gist-ID> gistID: <gist-ID>
@@ -114,7 +114,7 @@ For all values in between, the color will be interpolated.
- name: Get the Numbers - name: Get the Numbers
run: echo "ANSWER=42" >> $GITHUB_ENV run: echo "ANSWER=42" >> $GITHUB_ENV
- name: Create the Badge - name: Create the Badge
uses: schneegans/dynamic-badges-action@v1.2.0 uses: schneegans/dynamic-badges-action@v1.4.0
with: with:
auth: ${{ secrets.GIST_SECRET }} auth: ${{ secrets.GIST_SECRET }}
gistID: <gist-ID> gistID: <gist-ID>

View File

@@ -1,5 +1,5 @@
name: 'Dynamic Badges' name: 'Dynamic Badges'
description: 'Creates badge descriptions to be used with shields.io/endpoint and uploads them to a gist.' description: 'Create badges via shields.io/endpoint for your README.md which may change with every commit.'
branding: branding:
icon: 'tag' icon: 'tag'
color: 'green' color: 'green'

View File

@@ -1,5 +1,13 @@
# Changelog of the Dynamic Badges Action # Changelog of the Dynamic Badges Action
## [Dynamic Badges Action 1.4.0](https://github.com/Schneegans/dynamic-badges-action/tree/v1.4.0)
**Release Date:** 2022-05-15
#### Changes
* Fixed a bug which caused the action to fail if the value for the automatic color range was out of bounds. Thanks to [@LucasWolfgang](https://github.com/LucasWolfgang) for this fix!
## [Dynamic Badges Action 1.3.0](https://github.com/Schneegans/dynamic-badges-action/tree/v1.3.0) ## [Dynamic Badges Action 1.3.0](https://github.com/Schneegans/dynamic-badges-action/tree/v1.3.0)
**Release Date:** 2022-04-18 **Release Date:** 2022-04-18

View File

@@ -25,7 +25,7 @@ try {
if (minColorRange != '' && maxColorRange != '' && valColorRange != '') { if (minColorRange != '' && maxColorRange != '' && valColorRange != '') {
const max = parseFloat(maxColorRange); const max = parseFloat(maxColorRange);
const min = parseFloat(minColorRange); const min = parseFloat(minColorRange);
const val = parseFloat(valColorRange); let val = parseFloat(valColorRange);
if (val < min) val = min; if (val < min) val = min;
if (val > max) val = max; if (val > max) val = max;