Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ramonpaolo/bump-version
Github Action to get the version on the tag and parser it to `version` on package.json
https://github.com/ramonpaolo/bump-version
actions github-actions good-first-issue javascript nodejs opensource
Last synced: 13 days ago
JSON representation
Github Action to get the version on the tag and parser it to `version` on package.json
- Host: GitHub
- URL: https://github.com/ramonpaolo/bump-version
- Owner: ramonpaolo
- License: mit
- Created: 2023-02-26T01:02:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-07T14:53:08.000Z (4 months ago)
- Last Synced: 2024-10-20T04:05:14.271Z (27 days ago)
- Topics: actions, github-actions, good-first-issue, javascript, nodejs, opensource
- Language: JavaScript
- Homepage: https://github.com/marketplace/actions/bump-version-package-json
- Size: 843 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bump Version
This GitHub Actions, get the value of tag, and pass to the application, replacing the static version in `package.json`, automatically, without create a new commit and manually change the version.
This action, **works only** with push event of type **tags**
Example:
```yml
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
```If you use this action with a worflow that run without this trigger, this step will break.
## Supported Languages
At the moment, just support `package.json` that need exist in root folder
## Examples
```yml
name: Deploy Package to NPMon:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'jobs:
publish_npm:
name: Publishing to NPMruns-on: ubuntu-latest
permissions:
actions: write
contents: writesteps:
- uses: actions/checkout@v3- name: Setup NodeJs
uses: actions/setup-node@v3
with:
node-version: x.y # Version that you want use here
registry-url: https://registry.npmjs.org/- name: Install Packages
run: yarn- name: Bump Version of package.json
uses: ramonpaolo/[email protected]
with:
tag: ${{ github.ref_name }} # Accessing the context and get the reference_name, that in this case, is the tag that you created(ex: v1.0.0)
commit: true
branch_to_push: 'main'- name: Publish package to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # NPM Token necessary to deploy packages on pipelines CI/CD
```## Input parameters
| Name | Description | Required | Default |
| :------------- | :--------------------------- | :------- | :--------------- |
| tag | The tag created(v.\*.\*.\*) | `true` | "v1.0.0" |
| commit | Commit the bump | `false` | `false` |
| branch_to_push | Which branch to push | `false` | "main" |
| path | The path of the package.json | `false` | "./package.json" |## Output parameters
| Name | Description |
| :--------- | :---------------------------- |
| parsed-tag | v1.0.0(input) = 1.0.0(output) |