https://github.com/saionaro/extract-package-version
Allows you to get the npm version of the package in your Github Actions workflow
https://github.com/saionaro/extract-package-version
actions ci github-actions utility
Last synced: about 1 year ago
JSON representation
Allows you to get the npm version of the package in your Github Actions workflow
- Host: GitHub
- URL: https://github.com/saionaro/extract-package-version
- Owner: saionaro
- License: mit
- Created: 2020-03-05T13:16:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-16T10:53:43.000Z (about 2 years ago)
- Last Synced: 2025-04-03T05:01:41.985Z (about 1 year ago)
- Topics: actions, ci, github-actions, utility
- Language: JavaScript
- Size: 740 KB
- Stars: 11
- Watchers: 1
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# extract-package-version
Allows you to get the npm version of the package in your Github Actions workflow
## Usage
### Inputs
- `path`: The directory where package.json can be found (defaults to root of repo)
### Outputs
- `version`: The version of current NPM package
### Example workflow - get NPM version
```yaml
on: push
name: Create Build
jobs:
build:
name: Create Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: saionaro/extract-package-version@v1.3.0
id: package_ver
# from now you can access the version
- run: echo ${{ steps.package_ver.outputs.version }}
```
### Example workflow - get NPM version of subdirectory (useful in monorepos)
```yaml
on: push
name: Create Build
jobs:
build:
name: Create Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: saionaro/extract-package-version@v1.3.0
id: package_ver
with:
path: mysubdir
# from now you can access the version
- run: echo ${{ steps.package_ver.outputs.version }}
```