Skip to content

Commit 0f71092

Browse files
JasonCubicdtna-ux-novaEndBug
authored
added github-api-url and change axios to got (#135)
* added github-api-url and change axios to got * docs: format action manifest * chore: restore old package version I'll bump the version on the main branch Co-authored-by: jacubic <jason.cubic@daimler.com> Co-authored-by: Federico Grandi <fgrandi30@gmail.com>
1 parent 9f36e43 commit 0f71092

6 files changed

Lines changed: 563 additions & 86 deletions

File tree

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ You can use this GitHub action to check whether your npm package version has bee
77

88
The main difference between this action and many others out there is that this doesn't do a specific task (it doesn't publish to registries, create tags or releases, send notifications, ...) but instead gives you an output that you can use in other steps of your workflow as you prefer: this way you don't have to deal with stuff you don't care about ;)
99

10-
This action is heavily inspired by [`npm-publish-action`](https://github.com/pascalgn/npm-publish-action) by [pascal](https://github.com/pascalgn): if you only care about publishing your package to npm automatically, this is the simplest solution :thumbsup:
10+
This action is heavily inspired by [`npm-publish-action`](https://github.com/pascalgn/npm-publish-action) by [pascal](https://github.com/pascalgn): if you only care about publishing your package to npm automatically, this is the simplest solution :thumbsup:
1111

1212
## Usage
1313

@@ -21,7 +21,7 @@ You have to set up a step like this in your workflow (this assumes you've alread
2121

2222
with: # All these parameters are optional, check their descriptions to see if you need them.
2323

24-
# Whether to search in every commit's diff.
24+
# Whether to search in every commit's diff.
2525
# This is useful if you often do change the version without saying it in the commit message. If you always include the semver of the new version in your commit message when you bump versions then you can omit this.
2626
# Default: false
2727
diff-search: true
@@ -51,6 +51,10 @@ You have to set up a step like this in your workflow (this assumes you've alread
5151
# Please note that using the wrong value may make the action detect the change but fail to identify the type.
5252
# Default: ''
5353
static-checking: localIsNew
54+
55+
# If you are using an instance of GitHub Enterprise you can use this option to change the location of your GitHub api url.
56+
# Default: 'https://api.github.com'
57+
github-api-url: https://git.contoso.com/api/v3
5458
```
5559
5660
Now, when someone changes the version in `package.json` to `1.2.3` and pushes a commit with the message `<WHATEVER> 1.2.3` (eg. `Release 1.2.3` or `Bump version to v1.2.3`), output values are set (see Outputs below).
@@ -64,8 +68,8 @@ Please note that even if the action is built to be easier as possible to use, it
6468
- `version`: if the version has changed, it shows the version number (e.g. "1.0.2")
6569
- `commit`: if the version has changed, it shows the sha of the commit where the change has been found.
6670

67-
To access these outputs, you need to access the context of the step you previously set up: you can find more info about steps contexts [here](https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions#steps-context).
68-
If you set your step id to `check` you'll find the outputs at `steps.check.outputs.OUTPUT_NAME`: you can use these outputs as conditions for other steps.
71+
To access these outputs, you need to access the context of the step you previously set up: you can find more info about steps contexts [here](https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions#steps-context).
72+
If you set your step id to `check` you'll find the outputs at `steps.check.outputs.OUTPUT_NAME`: you can use these outputs as conditions for other steps.
6973
Here's an example:
7074

7175
```yaml
@@ -88,7 +92,7 @@ Please keep in mind that when the `static-checking` option is used the `commit`
8892

8993
### Publishing automatically to both NPM & GitHub Package Registry
9094

91-
If you want to see how to publish automatically your package to both NPM & GPR, please see [this](doc/auto-publish-example.yml) example workflow ;)
95+
If you want to see how to publish automatically your package to both NPM & GPR, please see [this](doc/auto-publish-example.yml) example workflow ;)
9296
You can also find a more in-depth guide in this [here](doc/auto-publish-walkthrough.md).
9397

9498
### Static-checking with your latest version on NPM

action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ inputs:
2424
description: A GitHub token to use when running on private repos
2525
required: false
2626
default: ${{ github.token }}
27+
github-api-url:
28+
description: The URL for your GitHub API. Some users may be using GitHub Enterprise and need to change this value.
29+
required: false
30+
default: https://api.github.com
2731

2832
outputs:
2933
changed:
@@ -37,7 +41,7 @@ outputs:
3741

3842
runs:
3943
using: node12
40-
main: "lib/index.js"
44+
main: 'lib/index.js'
4145

4246
branding:
4347
icon: package

lib/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)