Further modifications to the action part #2

This commit is contained in:
2021-05-09 17:25:59 +01:00
parent 10fec688be
commit d01a83771d
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -21,4 +21,4 @@ outputs:
description: 'Calculated semantic version'
runs:
using: 'docker'
image: docker://ghcr.io/lukaszraczylo/semver-generator:latest
image: Dockerfile
+4 -2
View File
@@ -5,7 +5,6 @@ FLAGS=""
if [[ -z "$INPUT_CONFIG_FILE" ]]; then
echo "Set the configuration file path."
exit 1
else
FLAGS="${FLAGS} -c $INPUT_CONFIG_FILE"
fi
@@ -13,7 +12,6 @@ fi
if [[ -z "$INPUT_REPOSITORY_URL" ]] && [[ -z "$INPUT_REPOSITORY_LOCAL" ]];
then
echo "You need to set either remote repository or repository local flags."
exit 1
fi
if [[ ! -z "$INPUT_REPOSITORY_URL" ]]; then
@@ -24,6 +22,10 @@ if [[ ! -z "$INPUT_REPOSITORY_LOCAL" ]]; then
FLAGS="${FLAGS} -l"
fi
if [[ "${FLAGS}" == "" && "$*" == "" ]]; then
exit 1
fi
OUT_SEMVER_GEN=$(/go/src/app/semver-gen generate $FLAGS $*)
echo "::set-output name=semantic_version::$(echo $OUT_SEMVER_GEN | sed -e 's|SEMVER ||g')"
echo $OUT_SEMVER_GEN