Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove initial input #4

Merged
merged 1 commit into from
Jan 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM ghcr.io/caarlos0/svu:v1.8.0
FROM ghcr.io/caarlos0/svu:v1.9.0
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ Defaults to `next`, but also supports: `major`, `minor` or `patch`.

**Optional**: Invokes `svu --prefix`'s behaviour, defaults to `v`.

## `initial`

If this is not set, the action will fail if the current version cannot be determined.
Otherwise this SemVer will be used as the initial version.

## Outputs

## `version`
Expand All @@ -40,15 +35,6 @@ with:
bump: 'next'
```

## Set an initial version

```yaml
uses: jsok/svu-version-bump-action@v1
with:
bump: 'next'
initial: '0.0.1'
```

## Custom pattern and prefix

```yaml
Expand All @@ -57,5 +43,4 @@ with:
bump: 'next'
pattern: 'foo/*'
prefix: 'foo/v'
initial: '0.0.1'
```
4 changes: 0 additions & 4 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ inputs:
description: 'Tag prefix'
required: false
default: 'v'
initial:
description: 'Initial version to set if the current version cannot be found'
required: false
outputs:
version:
description: 'Next version'
Expand All @@ -28,4 +25,3 @@ runs:
- ${{ inputs.bump }}
- ${{ inputs.pattern }}
- ${{ inputs.prefix }}
- ${{ inputs.initial }}
12 changes: 2 additions & 10 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,14 @@ set -eu
BUMP=$1
PATTERN=$2
PREFIX=$3
INITIAL=${4:-}

if svu --pattern="${PATTERN}" --prefix="${PREFIX}" current 2>/dev/null 1>/dev/null
then
version="$(svu --pattern="${PATTERN}" --prefix="${PREFIX}" "${BUMP}")"
version_without_prefix="$(svu --pattern="${PATTERN}" --prefix="${PREFIX}" --strip-prefix "${BUMP}")"
else
if [ -n "${INITIAL}" ]
then
echo "::warning Could not find a current version, initialising version to ${INITIAL}"
version="${PREFIX}${INITIAL}"
version_without_prefix="${INITIAL}"
else
echo "::error Could not find a current version!"
exit 1
fi
echo "::error Could not find a current version!"
exit 1
fi
echo "::group::Next version"
echo "${version}"
Expand Down