Skip to content

A GitHub Action which indicates when the package.json version has updated in the most recent commit

License

Notifications You must be signed in to change notification settings

JiPaix/package-json-updated-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action to detect changes in package.json version

This action outputs a variable 'has-updated' indicating that the package.json version was updated in the most recent commit.

Inputs

path

Sets the path to the package.json. Default 'package.json'.

Outputs

has-updated

Whether the package.json version has updated.

current-package-version

The current package.json version

Example usage

jobs:
  run-build-if-needed:
    runs-on: ubuntu-latest
    steps:
    - uses: JiPaix/package-json-updated-action@v1.0.3
      id: version-updated
      with:
        path: package.json
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    - uses: actions/checkout@v3
      if: steps.version-updated.outputs.has-updated
      with:
        fetch-depth: 1
    - uses: actions/setup-node@v3
      if: steps.version-updated.outputs.has-updated
      with:
        node-version: '16.x'
    - run: npm install
      if: steps.version-updated.outputs.has-updated
    - run: npm run build
      if: steps.version-updated.outputs.has-updated

About

A GitHub Action which indicates when the package.json version has updated in the most recent commit

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%