Comments (3)
I think the formatting of the if
statement may have changed; in my shared workflow definition, I had to format the if
statement like:
if: ${{ ! startsWith(github.event.head_commit.message, '[skip-version]') }}
Just in case anyone else stumbles along here!
from gh-action-bump-version.
Yes, it's true that running the action always bumps the version. If not specified it will increment the patch version.
You could create an if
condition for the workflow (or even just the Bump package version
step). For example, to base the condition on having a certain string in the commit message you can use a condition like this.
jobs:
version-bump:
if: "startsWith(github.event.head_commit.message, 'VERSION BUMP:')"
If you more frequently wish to bump the version than not bump the version, you could invert the condition to prevent it.
jobs:
version-bump:
if: "!startsWith(github.event.head_commit.message, 'NO BUMP:')"
These conditions are just examples.
As a real world example, our workflow creates an rc version bump by default, not a patch. To achieve that we used the following settings.
...
with:
# These words need to be part of a commit to trigger
# They are purposefully complex to avoid accidental triggers
major-wording: 'major-bb-protected'
minor-wording: 'minor-bb-protected'
patch-wording: 'patch-bb-protected'
# needs to be empty for all pushes to be prerelease
rc-wording: ''
# defaulting to bump prerelease version--default is patch
default: prerelease
preid: 'rc'
tag-prefix: 'v'
target-branch: 'main'
commit-message: 'CI: bumps version to {{version}}'
from gh-action-bump-version.
Another option is to include [ci skip]
in the commit message, from Github Docs. Note that this will skip all action workflows that would otherwise be triggered by the commit.
from gh-action-bump-version.
Related Issues (20)
- Build phips28/gh-action-bump-version/v8.0.18 Failing HOT 1
- Support pulling before pushing commits HOT 1
- Issue if the main branch is locked HOT 1
- Deployment event does not take in the target branch attribute
- v10? HOT 1
- Release not getting latest versions? HOT 2
- use >> $GITHUB_OUTPUT when runner is version 2.297.0 or greater
- Support hotfixes ("post-releases")
- Bumps minor or major instead of patch HOT 4
- Please support to change the package.json filename HOT 2
- Support for Selectively Adding Only package.json in git add HOT 1
- Trigger new workflow run on push HOT 1
- Add ability to provide value for parsing instead of commit messages HOT 1
- chore: bump node version HOT 1
- Error: Invalid format '├── https://github.com/sponsors/broofa' HOT 19
- Need to modify filename package.json to another filename. Is it possible? HOT 1
- Add option to add --no-verify to git commit HOT 3
- Anything that can be done to improve performance? HOT 4
- Issues with branch being up to date in a monorepo HOT 5
- Any tags pushed from the Bumped version commit not triggering any github workflows. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gh-action-bump-version.