Skip to content

Commit

Permalink
🔀 Merge pull request #27 from Schneegans/feature/configurable-host
Browse files Browse the repository at this point in the history
  • Loading branch information
Schneegans authored Oct 7, 2023
2 parents efee8f7 + d57076b commit 1929292
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ Embed the badge with:

### Optional Input Parameters

| Parameter | Description | Supported in SVG Mode |
| ------------- | -------------------------------------------------------------------------------------------------- | --------------------- |
| `forceUpdate` | Default is `false`. If set to `true`, the gist will be updated even if the content did not change. | ✅ |
| Parameter | Description | Supported in SVG Mode |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
| `host` | Default is `https://api.github.com/gists/`. You can change this if you're using GitHub enterprise. The URL will be something like `github-enterprise-hostname/api/v3/gists`. | ✅ |
| `forceUpdate` | Default is `false`. If set to `true`, the gist will be updated even if the content did not change. | ✅ |

### Shields.io Parameters (optional)

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ inputs:
message:
description: 'The right text of the badge'
required: true
host:
description: 'The base URL of the gist API'
default: 'https://api.github.com/gists/'
required: false
forceUpdate:
description: 'If set to true, the gist will be updated even if the content did not change'
default: 'false'
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#### Changes

- **SVG Mode:** If your gist filename ends with `.svg` instead of `.json`, the action will now generate an SVG badge instead of a JSON file. This is useful if you cannot use shields.io for some reason. However, this SVG mode does not support all features of shields.io. Thanks to [@runarberg](https://github.com/runarberg) for this contribution!
- **New `host` Parameter:** You can now specify the host for the gist API. This is useful if you want to use the action on a GitHub enterprise instance. Thanks to [@LucBerge](https://github.com/LucBerge) for this idea!
- The action now runs on Node 20 instead of Node 16.

## [Dynamic Badges Action 1.6.0](https://github.com/Schneegans/dynamic-badges-action/tree/v1.6.0)
Expand Down
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import core from '@actions/core';
import { makeBadge } from 'badge-maker';

const gistUrl = new URL(
core.getInput('gistID'),
'https://api.github.com/gists/'
);
const gistUrl = new URL(core.getInput('gistID'), core.getInput('host'));

// This uses the method above to update a gist with the given data. The user agent is
// required as defined in https://developer.github.com/v3/#user-agent-required
Expand Down

0 comments on commit 1929292

Please sign in to comment.