Skip to content

Commit

Permalink
Skip if there are no new commits in prerelease actions re-runs (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbe-arg committed Jan 4, 2023
1 parent 172098f commit 39d8e88
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions entrypoint.sh
Expand Up @@ -114,10 +114,9 @@ fi

# get current commit hash for tag
tag_commit=$(git rev-list -n 1 "$tag")

# get current commit hash
commit=$(git rev-parse HEAD)

# skip if there are no new commits for non-pre_release
if [ "$tag_commit" == "$commit" ]
then
echo "No new commits since previous tag. Skipping..."
Expand Down Expand Up @@ -159,6 +158,16 @@ esac

if $pre_release
then
# get current commit hash for tag
pre_tag_commit=$(git rev-list -n 1 "$pre_tag")
# skip if there are no new commits for pre_release
if [ "$pre_tag_commit" == "$commit" ]
then
echo "No new commits since previous pre_tag. Skipping..."
setOutput "new_tag" "$pre_tag"
setOutput "tag" "$pre_tag"
exit 0
fi
# already a pre-release available, bump it
if [[ "$pre_tag" =~ $new ]] && [[ "$pre_tag" =~ $suffix ]]
then
Expand Down

0 comments on commit 39d8e88

Please sign in to comment.