Skip to content

Commit dd05b2d

Browse files
authored
chore: adds npm provenance feature (#63)
* chore: adds npm provenance feature * chore: removes blank line * chore: update comments * chore: update comments * chore: update prettier changes
1 parent bf4e30a commit dd05b2d

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

actions/npm-publish/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# NPM publish
22

3-
This action publishes a package to the npm registry. It assumes that `npm` and `pnpm` is already setup, see the [setup PNPM action](../setup-pnpm/README.md) for a ready to use action to do this.
3+
This action publishes a package to the npm registry. It assumes that `npm` and `pnpm` is already setup, see the [setup PNPM action](../setup-pnpm/README.md) for a ready to use action to do this. Starting from npm version 11.5.1, OIDC is supported.
44

55
## Action inputs
66

7-
| Input | Description | Default |
8-
| ----------------- | --------------------------------------------------------------------- | ---------- |
9-
| `token` | The npm token to authenticate with the npm registry. | _required_ |
10-
| `is_beta` | Publish the package as a beta version. Expects a stringified boolean. | `'false'` |
11-
| `package_manager` | The package manager to use for publishing. | `'npm'` |
7+
| Input | Description. | Default |
8+
| ------------------- | ----------------------------------------------------------------------------- | --------- |
9+
| `token` | The npm token to authenticate with the npm registry. | `''` |
10+
| `is_beta` | Publish the package as a beta version. Expects a stringified boolean. | `'false'` |
11+
| `package_manager` | The package manager to use for publishing. | `'npm'` |
12+
| `enable_provenance` | Enable the generation and publication of NPM's package provenance statements. | `'true'` |
1213

1314
## Action outputs
1415

actions/npm-publish/action.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
description: 'The package manager to use for publishing.'
1414
required: false
1515
default: 'npm'
16+
enable_provenance:
17+
description: "Enable the generation and publication of NPM's package provenance statements."
18+
required: false
19+
default: 'true'
1620

1721
outputs:
1822
artifact_filepath:
@@ -27,6 +31,7 @@ runs:
2731
env:
2832
NODE_AUTH_TOKEN: ${{ inputs.token }}
2933
IS_BETA: ${{ inputs.is_beta }}
34+
NPM_CONFIG_PROVENANCE: ${{ inputs.enable_provenance }}
3035
shell: bash
3136
run: |
3237
artifact_filepath=$(pwd)/$(${{ inputs.package_manager }} pack --json | jq -r '.[0].filename')

0 commit comments

Comments
 (0)