Skip to content

Commit e3ff9a1

Browse files
committed
Update example to better showcase the GHA capabilities
1 parent 0650ca8 commit e3ff9a1

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

README.md

+20-3
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,15 @@ name: Bump version
240240

241241
on:
242242
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
243252

244253
jobs:
245254
build:
@@ -249,20 +258,28 @@ jobs:
249258
uses: actions/checkout@v4
250259

251260
- name: Bump version
261+
id: bump
252262
uses: callowayproject/bump-my-version@master
253263
env:
254264
BUMPVERSION_TAG: "true"
255265
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 }}!"
257273
```
258274
259275
Inputs for the bump-my-version action are:
260276
1. `args` - The arguments to pass to the `bump-my-version bump [args]` command. See the CLI documentation for more information.
261277
2. `github-token` - The GitHub token to use for committing and tagging. This is optional.
262278

263279
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.
266283

267284
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).
268285

0 commit comments

Comments
 (0)