You've already forked dynamic-badges-action
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ba090896c | ||
|
|
2f15321252 | ||
|
|
a96c4be21f | ||
|
|
fe55f62a4b | ||
|
|
9ee069bab8 |
2
.github/workflows/badges.yml
vendored
2
.github/workflows/badges.yml
vendored
@@ -8,7 +8,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Get the Numbers
|
- name: Get the Numbers
|
||||||
run: echo "::set-env name=ANSWER::42"
|
run: echo "ANSWER=42" >> $GITHUB_ENV
|
||||||
- name: Create the Badge
|
- name: Create the Badge
|
||||||
uses: schneegans/dynamic-badges-action@master
|
uses: schneegans/dynamic-badges-action@master
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -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, ...
|
* Show metadata of your repository such as [lines of code, comment line percentage](https://schneegans.github.io/tutorials/2020/08/16/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?
|
||||||
@@ -49,7 +49,7 @@ https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/schneegan
|
|||||||
color: orange
|
color: orange
|
||||||
```
|
```
|
||||||
|
|
||||||
Once the action is executed, got to your gist.
|
Once the action is executed, go to your gist.
|
||||||
There should be a new file called `test.json`.
|
There should be a new file called `test.json`.
|
||||||
You can view the raw content of this file at `https://gist.githubusercontent.com/<user>/<gist-ID>/raw/test.json`.
|
You can view the raw content of this file at `https://gist.githubusercontent.com/<user>/<gist-ID>/raw/test.json`.
|
||||||
Embed the badge with:
|
Embed the badge with:
|
||||||
@@ -87,7 +87,7 @@ A common usage pattern of this action is to create environment variables in prev
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: Get the Numbers
|
- name: Get the Numbers
|
||||||
run: echo "::set-env name=ANSWER::42"
|
run: echo "ANSWER=42" >> $GITHUB_ENV
|
||||||
- name: Create the Badge
|
- name: Create the Badge
|
||||||
uses: schneegans/dynamic-badges-action@v1.0.0
|
uses: schneegans/dynamic-badges-action@v1.0.0
|
||||||
with:
|
with:
|
||||||
@@ -133,4 +133,4 @@ This means, given a version number MAJOR.MINOR.PATCH, we will increment the:
|
|||||||
|
|
||||||
1. MAJOR version when we make incompatible API changes,
|
1. MAJOR version when we make incompatible API changes,
|
||||||
2. MINOR version when we add functionality in a backwards compatible manner, and
|
2. MINOR version when we add functionality in a backwards compatible manner, and
|
||||||
3. PATCH version when we make backwards compatible bug fixes.
|
3. PATCH version when we make backwards compatible bug fixes.
|
||||||
|
|||||||
5
index.js
5
index.js
@@ -86,6 +86,9 @@ try {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
res => {
|
res => {
|
||||||
|
if (res.statusCode < 200 || res.statusCode >= 400) {
|
||||||
|
core.setFailed('Failed to create gist, response status code: ' + res.statusCode + ', status message: ' + res.statusMessage);
|
||||||
|
}
|
||||||
let body = '';
|
let body = '';
|
||||||
res.on('data', data => body += data);
|
res.on('data', data => body += data);
|
||||||
res.on('end', () => console.log('result:' + body));
|
res.on('end', () => console.log('result:' + body));
|
||||||
@@ -96,4 +99,4 @@ try {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error);
|
core.setFailed(error);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user