Skip to content

Commit

Permalink
Update to node 18 and set bash -e for error catching (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbe-arg committed May 10, 2023
1 parent d77194f commit 72f3a54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM node:16-alpine
FROM node:18-alpine
LABEL "repository"="https://github.com/anothrNick/github-tag-action"
LABEL "homepage"="https://github.com/anothrNick/github-tag-action"
LABEL "maintainer"="Nick Sjostrom"
Expand Down
12 changes: 6 additions & 6 deletions entrypoint.sh
@@ -1,6 +1,6 @@
#!/bin/bash

set -o pipefail
set -eo pipefail

# config
default_semvar_bump=${DEFAULT_BUMP:-minor}
Expand Down Expand Up @@ -81,12 +81,12 @@ preTagFmt="^v?[0-9]+\.[0-9]+\.[0-9]+(-$suffix\.[0-9]+)$"
# get latest tag that looks like a semver (with or without v)
case "$tag_context" in
*repo*)
tag="$(git for-each-ref --sort=-v:refname --format '%(refname:lstrip=2)' | grep -E "$tagFmt" | head -n 1)"
pre_tag="$(git for-each-ref --sort=-v:refname --format '%(refname:lstrip=2)' | grep -E "$preTagFmt" | head -n 1)"
tag="$(git for-each-ref --sort=-v:refname --format '%(refname:lstrip=2)' | (grep -E "$tagFmt" || true) | head -n 1)"
pre_tag="$(git for-each-ref --sort=-v:refname --format '%(refname:lstrip=2)' | (grep -qs -E "$preTagFmt" || true) | head -n 1)"
;;
*branch*)
tag="$(git tag --list --merged HEAD --sort=-v:refname | grep -E "$tagFmt" | head -n 1)"
pre_tag="$(git tag --list --merged HEAD --sort=-v:refname | grep -E "$preTagFmt" | head -n 1)"
tag="$(git tag --list --merged HEAD --sort=-v:refname | (grep -E "$tagFmt" || true) | head -n 1)"
pre_tag="$(git tag --list --merged HEAD --sort=-v:refname | (grep -qs -E "$preTagFmt" || true) | head -n 1)"
;;
* ) echo "Unrecognised context"
exit 1;;
Expand Down Expand Up @@ -178,7 +178,7 @@ esac
if $pre_release
then
# get current commit hash for tag
pre_tag_commit=$(git rev-list -n 1 "$pre_tag")
pre_tag_commit=$(git rev-list -n 1 "$pre_tag" || true)
# skip if there are no new commits for pre_release
if [ "$pre_tag_commit" == "$commit" ]
then
Expand Down

0 comments on commit 72f3a54

Please sign in to comment.