mirror of
https://github.com/elgohr/Publish-Docker-Github-Action.git
synced 2026-03-12 18:07:12 -04:00
Check booleans for falseness
This commit is contained in:
@@ -30,11 +30,11 @@ function main() {
|
||||
if uses "${INPUT_BUILDARGS}"; then
|
||||
addBuildArgs
|
||||
fi
|
||||
if uses "${INPUT_CACHE}"; then
|
||||
if usesBoolean "${INPUT_CACHE}"; then
|
||||
useBuildCache
|
||||
fi
|
||||
|
||||
if uses "${INPUT_SNAPSHOT}"; then
|
||||
if usesBoolean "${INPUT_SNAPSHOT}"; then
|
||||
pushWithSnapshot
|
||||
else
|
||||
pushWithoutSnapshot
|
||||
@@ -62,7 +62,7 @@ function translateDockerTag() {
|
||||
INPUT_NAME=$(echo ${INPUT_NAME} | cut -d':' -f1)
|
||||
elif isOnMaster; then
|
||||
TAG="latest"
|
||||
elif isGitTag && uses "${INPUT_TAG_NAMES}"; then
|
||||
elif isGitTag && usesBoolean "${INPUT_TAG_NAMES}"; then
|
||||
TAG=$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")
|
||||
elif isGitTag; then
|
||||
TAG="latest"
|
||||
@@ -114,6 +114,10 @@ function uses() {
|
||||
[ ! -z "${1}" ]
|
||||
}
|
||||
|
||||
function usesBoolean() {
|
||||
[ ! -z "${1}" ] && [ "${1}" = "true" ]
|
||||
}
|
||||
|
||||
function pushWithSnapshot() {
|
||||
local TIMESTAMP=`date +%Y%m%d%H%M%S`
|
||||
local SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-6)
|
||||
|
||||
Reference in New Issue
Block a user