GitHub Action
Extract Package Version
v1.3.0
Latest version
Allows you to get the npm version of the package in your Github Actions workflow
path
: The directory where package.json can be found (defaults to root of repo)
version
: The version of current NPM package
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 }}
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 }}