Skip to content

Export Version

Actions

About

Extract package version from package.json and export it
v1.1.0
Latest
StarΒ (1)

πŸŽ— Export Version

build MIT License Language PRs Welcome website

Extract package version from package.json and export it

πŸš€ Usage

Create a .github/workflows/export-version.yml file in the repository you want to install this action, then add the following to it:

name: Export Version
on:
  push:
    branches:
      - master
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: wow-actions/export-version@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The default config will generate a file "src/version.ts" with the following content:

/* eslint-disable */

/**
 * Auto generated version file, do not modify it!
 */
const version = 'xxx'
export { version }

Inputs

Various inputs are defined to let you configure the action:

Note: Workflow command and parameter names are not case-sensitive.

Name Description Default
GITHUB_TOKEN The GitHub token for authentication N/A
source The package.json path or the directory path contains a package.json file 'package.json'
target The auto generated target file path 'src/version.ts'
template Template to render the target file content
Placeholder {{version}} is supportted
...
commitMessage Commit message to create/update the target file 'chore: update version file [skip ci]'

πŸ”– License

The scripts and documentation in this project are released under the MIT License

Export Version is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Extract package version from package.json and export it
v1.1.0
Latest

Export Version is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.