6 Commits

Author SHA1 Message Date
Simon Schneegans
65787a717d 📝 Add changelog 2022-03-26 12:31:56 +01:00
Simon Schneegans
cfd1eebb35 🔧 Do not print result body 2022-03-26 10:50:40 +01:00
Simon Schneegans
42207bfa4c 📝 Add note on gist file name 2022-03-26 10:47:07 +01:00
Simon Schneegans
4c1242cfa4 Merge pull request #9 from Bhupesh-V/minor-docs-improvement
clearify using custom colors in labels
2021-12-20 20:36:13 +01:00
Bhupesh Varshney
7788d4f27b Update README.md 2021-12-18 22:45:54 +05:30
Simon Schneegans
a298000e06 📝 Update tags in README.md 2021-06-16 20:07:09 +02:00
3 changed files with 39 additions and 8 deletions

View File

@@ -33,13 +33,13 @@ https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/schneegan
## Configuration
1. Head over to [gist.github.com](https://gist.github.com/) and create a new gist. You will need the ID of the gist (this is the long alphanumerical part of its URL) later.
1. Head over to [gist.github.com](https://gist.github.com/) and create a new gist. You can name the file `test.json`, but this can be changed later as well. You will need the ID of the gist (this is the long alphanumerical part of its URL) later.
2. Navigate to [github.com/settings/tokens](https://github.com/settings/tokens) and create a new token with the *gist* scope.
3. Go to the *Secrets* page of the settings of your repository and add this token as a new secret. You can give it any name, for example `GIST_SECRET`.
4. Add something like the following to your workflow:
```yml
- name: Create Awesome Badge
uses: schneegans/dynamic-badges-action@v1.0.0
uses: schneegans/dynamic-badges-action@v1.1.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: <gist-ID>
@@ -71,7 +71,7 @@ Gist Parameter | Description
`label` | Required. The left text of the badge.
`message` | Required. The right text of the badge.
`labelColor` | The left color of the badge.
`color` | The right color of the badge.
`color` | The right color of the badge. For custom colors wrap color string in quotes `"#bf155b"`
`isError` | The color will be red and cannot be overridden.
`namedLogo` | A logo name from [simpleicons.org](http://simpleicons.org/).
`logoSvg` | An svg-string to be used as logo.
@@ -89,7 +89,7 @@ A common usage pattern of this action is to create environment variables in prev
- name: Get the Numbers
run: echo "ANSWER=42" >> $GITHUB_ENV
- name: Create the Badge
uses: schneegans/dynamic-badges-action@v1.0.0
uses: schneegans/dynamic-badges-action@v1.1.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: <gist-ID>

30
changelog.md Normal file
View File

@@ -0,0 +1,30 @@
# Changelog of the Dynamic Badges Action
## [Dynamic Badges Action 1.2.0](https://github.com/Schneegans/dynamic-badges-action/tree/v1.2.0)
**Release Date:** 2022-03-26
#### Changes
* The action does not log the response of writing the Gist anymore.
* Added this changelog.
## [Dynamic Badges Action 1.1.0](https://github.com/Schneegans/dynamic-badges-action/tree/v1.1.0)
**Release Date:** 2021-06-16
#### Changes
* The action now logs an error message when writing the Gist failed.
* Used new API for setting environment variables in the README.md examples.
## [Dynamic Badges Action 1.0.0](https://github.com/Schneegans/dynamic-badges-action/tree/v1.0.0)
**Release Date:** 2020-08-16
#### Changes
* Initial publication on GitHub.

View File

@@ -87,11 +87,12 @@ try {
},
res => {
if (res.statusCode < 200 || res.statusCode >= 400) {
core.setFailed('Failed to create gist, response status code: ' + res.statusCode + ', status message: ' + res.statusMessage);
core.setFailed(
'Failed to create gist, response status code: ' + res.statusCode +
', status message: ' + res.statusMessage);
} else {
console.log('Success!');
}
let body = '';
res.on('data', data => body += data);
res.on('end', () => console.log('result:' + body));
});
req.write(request);