Skip to content

Commit

Permalink
feat(bump-version): allow dirty working directory by default
Browse files Browse the repository at this point in the history
  • Loading branch information
disrupted committed Jan 15, 2025
1 parent 3373937 commit d1e9339
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions actions/bump-version/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
description: ""
required: false
default: ""
allow-dirty:
description: "Allow unclean Git status in the working directory."
required: false
default: "true"

outputs:
release-version:
Expand All @@ -35,6 +39,9 @@ runs:
run: |
parameters=(--no-commit --no-tag ${{ inputs.release-type }})
echo "old-version=$(python -c "from configparser import ConfigParser; cfg = ConfigParser(); cfg.read('.bumpversion.cfg'); print(cfg['bumpversion']['current_version'])")" >> "$GITHUB_OUTPUT"
if [[ "${{ inputs.allow-dirty }}" == "true" ]]; then
parameters+=(--allow-dirty)
fi
if [ -n "${{ inputs.new-version }}" ]; then
parameters+=(--new-version ${{ inputs.new-version }})
fi
Expand Down
11 changes: 6 additions & 5 deletions docs/actions/bump-version/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ steps:
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
| ----------------- | ------ | -------- | ------- | ----------------------------------------------------- |
| new-version | string | false | | |
| release-type | string | true | | The type of the release (major, minor or patch). |
| working-directory | string | false | `"."` | The directory containing the `.bumpversion.cfg` file. |
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
| ----------------- | ------ | -------- | -------- | ----------------------------------------------------- |
| allow-dirty | string | false | `"true"` | Allow unclean Git status in the working directory. |
| new-version | string | false | | |
| release-type | string | true | | The type of the release (major, minor or patch). |
| working-directory | string | false | `"."` | The directory containing the `.bumpversion.cfg` file. |

<!-- AUTO-DOC-INPUT:END -->

Expand Down

0 comments on commit d1e9339

Please sign in to comment.