You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58-14
Original file line number
Diff line number
Diff line change
@@ -31,20 +31,45 @@ This package can be used three different ways:
31
31
32
32
- 🤖 A [**GitHub Action**](#github-action) as part of your CI/CD process
33
33
34
-
- 🧩 A [**function**](#javascript-function) that you call in your JavaScript code
34
+
- 🧩 A [**function**](#javascript-api) that you call in your JavaScript code
35
35
36
36
- 🖥 A [**CLI**](#command-line-interface) that you run in your terminal
37
37
38
38
## v2 Migration Guide
39
39
40
40
The v1 to v2 upgrade brought a few notable **breaking changes**. To migrate, make the following updates:
41
41
42
-
- The `type` output is now an empty string instead of `none` when no release occurs
42
+
- The `type` output is now an empty string instead of `'none'` when no release occurs
43
43
```diff
44
44
- run: echo "Version changed!"
45
45
- if: ${{ steps.publish.outputs.type != 'none' }}
46
46
+ if: ${{ steps.publish.outputs.type }}
47
47
```
48
+
- The `--ignore-scripts` option is now passed to `npm publish` as a security precaution. If you define any publish lifecycle scripts - `prepublishOnly`, `prepack`, `prepare`, `postpack`, `publish`, `postpublish` - run them explicitly or set the `ignore-scripts` input to `false`.
49
+
```diff
50
+
with:
51
+
token: ${{ secrets.NPM_TOKEN }}
52
+
+ ignore-scripts: false
53
+
```
54
+
- The workflow's `.npmrc` file is not longer modified. If you have any workarounds to adjust for this misbehavior - for example, if you're using `actions/setup-node` to configure `.npmrc` - you should remove them.
55
+
56
+
```diff
57
+
- uses: actions/setup-node@v3
58
+
with:
59
+
node-version: '18'
60
+
registry-url: https://registry.npmjs.org/
61
+
62
+
- uses: JS-DevTools/npm-publish@v1
63
+
with:
64
+
token: ${{ secrets.NPM_TOKEN }}
65
+
66
+
- name: Do some more stuff with npm
67
+
run: npm whoami
68
+
env:
69
+
- INPUT_TOKEN: ${{ secrets.NPM_TOKEN }}
70
+
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
71
+
```
72
+
48
73
- The `check-version` and `greater-version-only` options have been removed and replaced with `strategy`.
49
74
- Use `strategy: all` (default) to publish all versions that do not yet exist in the registry.
50
75
```diff
@@ -62,10 +87,24 @@ The v1 to v2 upgrade brought a few notable **breaking changes**. To migrate, mak
62
87
- greater-version-only: true
63
88
+ strategy: upgrade
64
89
```
65
-
- `check-version: false` has been removed. You don't need this action if you're not checking already published versions; use `npm` directly, instead.
90
+
- `check-version: false` has been removed. You may not need this action if you're not checking already published versions; [you can `npm` directly][publishing-nodejs-packages], instead.
91
+
```diff
92
+
- - uses: JS-DevTools/npm-publish@v1
93
+
- with:
94
+
- token: ${{ secrets.NPM_TOKEN }}
95
+
- check-version: false
96
+
+ - uses: actions/setup-node@v3
97
+
+ with:
98
+
+ node-version: '18'
99
+
+ registry-url: https://registry.npmjs.org/
100
+
+ - run: npm publish
101
+
+ env:
102
+
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
103
+
```
66
104
67
105
See the [change log][] for more details and other changes in the v2 release.
0 commit comments