diff --git a/actions/npm-publish/README.md b/actions/npm-publish/README.md index f2b440b..b25f9f9 100644 --- a/actions/npm-publish/README.md +++ b/actions/npm-publish/README.md @@ -1,14 +1,15 @@ # NPM publish -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. +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. ## Action inputs -| Input | Description | Default | -| ----------------- | --------------------------------------------------------------------- | ---------- | -| `token` | The npm token to authenticate with the npm registry. | _required_ | -| `is_beta` | Publish the package as a beta version. Expects a stringified boolean. | `'false'` | -| `package_manager` | The package manager to use for publishing. | `'npm'` | +| Input | Description. | Default | +| ------------------- | ----------------------------------------------------------------------------- | --------- | +| `token` | The npm token to authenticate with the npm registry. | `''` | +| `is_beta` | Publish the package as a beta version. Expects a stringified boolean. | `'false'` | +| `package_manager` | The package manager to use for publishing. | `'npm'` | +| `enable_provenance` | Enable the generation and publication of NPM's package provenance statements. | `'true'` | ## Action outputs diff --git a/actions/npm-publish/action.yaml b/actions/npm-publish/action.yaml index f6a1731..43cf8dc 100644 --- a/actions/npm-publish/action.yaml +++ b/actions/npm-publish/action.yaml @@ -13,6 +13,10 @@ inputs: description: 'The package manager to use for publishing.' required: false default: 'npm' + enable_provenance: + description: "Enable the generation and publication of NPM's package provenance statements." + required: false + default: 'true' outputs: artifact_filepath: @@ -27,6 +31,7 @@ runs: env: NODE_AUTH_TOKEN: ${{ inputs.token }} IS_BETA: ${{ inputs.is_beta }} + NPM_CONFIG_PROVENANCE: ${{ inputs.enable_provenance }} shell: bash run: | artifact_filepath=$(pwd)/$(${{ inputs.package_manager }} pack --json | jq -r '.[0].filename')