https://github.com/step-security/npm-get-version-action
This Action scans for a package.json file and reads the version number from that.
https://github.com/step-security/npm-get-version-action
step-security-maintained-actions
Last synced: 2 months ago
JSON representation
This Action scans for a package.json file and reads the version number from that.
- Host: GitHub
- URL: https://github.com/step-security/npm-get-version-action
- Owner: step-security
- License: mit
- Created: 2023-12-02T09:33:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-17T13:39:13.000Z (almost 2 years ago)
- Last Synced: 2025-01-01T02:28:35.744Z (over 1 year ago)
- Topics: step-security-maintained-actions
- Language: Shell
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# StepSecurity Maintained npm-get-version-action Actions
Forked from: [martinbeentjes/npm-get-version-action](https://github.com/martinbeentjes/npm-get-version-action)
This GitHub Action retrieves the package version from the package.json file and sets the version in the `current-version` output value usable in your workflow file.
## Example
To use this action in your project, use the following:
```yaml
- name: get-npm-version
id: package-version
uses: step-security/npm-get-version-action@v1
```
The Action sets an output variable called `current-version` which can be used in a following step by using `${{ steps.package-version.outputs.current-version}}`.
If you are using a monorepo or otherwise have some packages in a subdirectory of your repo, add the path to the `package.json` as a parameter:
```yaml
- name: get-npm-version
id: package-version
uses: step-security/npm-get-version-action@v1
with:
path: packages/
```