diff --git a/actions/bump-version/action.yaml b/actions/bump-version/action.yaml index a6bea5a61..945feeb2b 100644 --- a/actions/bump-version/action.yaml +++ b/actions/bump-version/action.yaml @@ -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: @@ -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 diff --git a/docs/actions/bump-version/README.md b/docs/actions/bump-version/README.md index 0aefe049f..4e76cc097 100644 --- a/docs/actions/bump-version/README.md +++ b/docs/actions/bump-version/README.md @@ -38,11 +38,12 @@ steps: -| 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. |