Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 23 days 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 4 years ago)
- Default Branch: master
- Last Pushed: 2024-06-16T10:53:43.000Z (5 months ago)
- Last Synced: 2024-10-13T14:35:04.299Z (24 days ago)
- Topics: actions, ci, github-actions, utility
- Language: JavaScript
- Size: 740 KB
- Stars: 11
- Watchers: 2
- 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: pushname: Create Build
jobs:
build:
name: Create Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4- uses: saionaro/[email protected]
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: pushname: Create Build
jobs:
build:
name: Create Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4- uses: saionaro/[email protected]
id: package_ver
with:
path: mysubdir
# from now you can access the version
- run: echo ${{ steps.package_ver.outputs.version }}
```