Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions actions/npm-publish/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 5 additions & 0 deletions actions/npm-publish/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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')
Expand Down