You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+20-3
Original file line number
Diff line number
Diff line change
@@ -240,6 +240,15 @@ name: Bump version
240
240
241
241
on:
242
242
workflow_dispatch:
243
+
bump-type:
244
+
description: 'Bump type'
245
+
required: true
246
+
default: 'patch'
247
+
type: choice
248
+
options:
249
+
- major
250
+
- minor
251
+
- patch
243
252
244
253
jobs:
245
254
build:
@@ -249,20 +258,28 @@ jobs:
249
258
uses: actions/checkout@v4
250
259
251
260
- name: Bump version
261
+
id: bump
252
262
uses: callowayproject/bump-my-version@master
253
263
env:
254
264
BUMPVERSION_TAG: "true"
255
265
with:
256
-
args: "major"
266
+
args: ${{ inputs.bump-type }}
267
+
github-token: ${{ secrets.GH_TOKEN }}
268
+
269
+
- name: Check
270
+
if: steps.bump.outputs.bumped == 'true'
271
+
run: |
272
+
echo "Version was bumped from ${{ steps.bump.outputs.previous-version }} to ${{ steps.bump.outputs.current-version }}!"
257
273
```
258
274
259
275
Inputs for the bump-my-version action are:
260
276
1. `args` - The arguments to pass to the `bump-my-version bump [args]` command. See the CLI documentation for more information.
261
277
2. `github-token` - The GitHub token to use for committing and tagging. This is optional.
262
278
263
279
Output:
264
-
1. `bump` - Boolean flag for whether the version was bumped.
265
-
2. `version` - [TODO] The new version number.
280
+
1. `bumped` - Boolean flag for whether the version was bumped.
281
+
2. `previous-version` - Version before bump was performed.
282
+
3. `current-version` - Version after performing bump.
266
283
267
284
If you want to ensure that workflows set up with on-push trigger will also start based on those newly pushed commits or tags, you need to provide a custom PAT (`github-token`). See [here](https://github.com/orgs/community/discussions/25702).
0 commit comments