Skip to content

Allows you to get the npm version of the package in your Github Actions workflow

License

Notifications You must be signed in to change notification settings

edialog24/extract-package-version

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

on: push

name: Create Build

jobs:
  build:
    name: Create Build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@master

      - name: Extract version
        id: extract_version
        uses: Saionaro/extract-package-version@v1.0.6
      # From now you can access the version
      - name: Print version
        run: echo ${{ steps.extract_version.outputs.version }}

Example workflow - get NPM version of subdirectory

on: push

name: Create Build

jobs:
  build:
    name: Create Build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@master

      - name: Extract version
        id: extract_version
        uses: Saionaro/extract-package-version@v1.1.1
        with:
          path: mysubdir
      # From now you can access the version
      - name: Print version
        run: echo ${{ steps.extract_version.outputs.version }}

About

Allows you to get the npm version of the package in your Github Actions workflow

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%