Giter Site home page Giter Site logo

bump's Introduction

Bump Action

Bump allows you to..well...bump an npm package version using a commit message, and push the package.json update back to the repository.

Create an action from this template

Click the Use this Template and provide the new repo details for your action

Options

inputs:

github_token

required
github access token

user

user name
default: the user of the current push

email

user email
default: current user email

branch

branch to work against
default: master

unrelated

use --allow-unrelated-histories deafult: false

outputs:

version

the version being tagged and pushed.

Bump strategy

If your head (latest) commit has the keywords #patch, #minor or #major - this action will use that to perform the bump. Defaults to patch.

Usage

You can use this action by referencing any branch or git tag:

bump:
  runs-on: ubuntu-latest
  steps:
    - uses: tool3/bump@master #latest
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        user: "First Last"
        email: "[email protected]"

⚠️ Important usage notes

  • this action requires @actions/checkout to be defined in a previous step. e.g:
bump:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@master
    - uses: tool3/bump@master
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        user: "First Last"
        email: "[email protected]"
  • this action pushes the package.json version update back to the repo (defaults to master).

See the actions tab for runs of this action! 🚀

Example

name: release

on:
  push:
    branches:
      - release

jobs:
  tag:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: tool3/bump@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          unrelated: true

  publisher:
    needs: tag
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: tool3/publisher@master
        with:
          npm_token: ${{ secrets.NPM_TOKEN }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          scope: "@tool3"

bump's People

Contributors

dependabot[bot] avatar maduq1 avatar tool3 avatar web-flow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bump's Issues

Error: Cannot destructure property 'email' of 'undefined' or 'null'.

Hi,
I keep getting this error while using this action:

Error: Cannot destructure property 'email' of 'undefined' or 'null'.

This is my workflow:

on: [workflow_dispatch]
name: Build Test and Publish
jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 14.x
      - run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUBTOKEN }}" > ~/.npmrc
      - run: npm ci
      - run: npm test

  publish-gpr:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUBTOKEN }}" > ~/.npmrc
      - run: npm ci
      - uses: actions/setup-node@v1
        with:
          node-version: 12
          registry-url: https://npm.pkg.github.com/
      - uses: tool3/[email protected]
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          unrelated: true
      - run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{secrets.GITHUBTOKEN}}

Any help is appreciated.

Skipping branch status checks

Hello! I would like to enable Github branch protection rules on my master branch. Is it possible to update this action to skip status checks when making a commit to increase the package version?

I'm guessing it has to be added here

bump/index.js

Line 48 in 876e407

await exec('npm', ['version', strategy, '--no-commit-hooks', '-m', `${commitMessage} %s`]);

Github's example
https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-status-checks#skipping-and-requesting-checks-for-individual-commits

$ git commit -m "Update README.
>
>
skip-checks: true

Deprecation warnings

Hi!
I've noticed deprecation warnings using bump-version action:

[bump-version] Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: tool3/[email protected]. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

[bump-version] The 'set-output' command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Is there any plans to upgrade the action to use more fresh version of Node?
Thanks.

Missing version from output?

Not sure if it's how i'm attempting to use the action but it looks like version is missing from the output?
I was expecting to see something like this in the repo code.
core.setOutput('version', newVersion)

Support node16 in self-hosted runners

Hi, we use your tool since some months ago in a self-hosted Linux runner and it works like a charm. But we had to upgrade the node version to 16 because some other deprecations. We also received a notice saying node12 is going EOL, so it won't be supported anymore.

From what I see in the code, it should be just a matter of changing the node version in the workflow definition, but I am not that familiar with development of this kind of tool to be sure everything else will work. In any case, I will try to take a look myself.

On the while, could you please check it? Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.