This GitHub action gets the version number from a package.json.
on: [push]
jobs:
test-package-version:
runs-on: ubuntu-latest
name: Get package version
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get package version
id: get_version
uses: daschaa/[email protected]
with:
path: './package.json'
- name: Output package version
run: echo "The package version is ${{ steps.get_version.outputs.current-version }}"
Parameter | Description | Default |
---|---|---|
path |
Path to package.json | package.json |
The following output values can be accessed via ${{ steps.<step-id>.outputs.<output-name> }}
:
Name | Description | Type |
---|---|---|
current-version |
The version number extracted from the package.json | string |
The source code for this project is released under the MIT License. This project is not associated with GitHub.