Skip to content

Commit

Permalink
Update example to better showcase the GHA capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
rgryta committed Aug 30, 2024
1 parent 0650ca8 commit e3ff9a1
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ name: Bump version

on:
workflow_dispatch:
bump-type:
description: 'Bump type'
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch

jobs:
build:
Expand All @@ -249,20 +258,28 @@ jobs:
uses: actions/checkout@v4

- name: Bump version
id: bump
uses: callowayproject/bump-my-version@master
env:
BUMPVERSION_TAG: "true"
with:
args: "major"
args: ${{ inputs.bump-type }}
github-token: ${{ secrets.GH_TOKEN }}

- name: Check
if: steps.bump.outputs.bumped == 'true'
run: |
echo "Version was bumped from ${{ steps.bump.outputs.previous-version }} to ${{ steps.bump.outputs.current-version }}!"
```
Inputs for the bump-my-version action are:
1. `args` - The arguments to pass to the `bump-my-version bump [args]` command. See the CLI documentation for more information.
2. `github-token` - The GitHub token to use for committing and tagging. This is optional.

Output:
1. `bump` - Boolean flag for whether the version was bumped.
2. `version` - [TODO] The new version number.
1. `bumped` - Boolean flag for whether the version was bumped.
2. `previous-version` - Version before bump was performed.
3. `current-version` - Version after performing bump.

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

Expand Down

0 comments on commit e3ff9a1

Please sign in to comment.