From 18bd6b724a534d153710c5c4e82f1f80f10454a8 Mon Sep 17 00:00:00 2001 From: Elliot Jackson <13633636+elliotmjackson@users.noreply.github.com> Date: Fri, 4 Nov 2022 19:03:55 -0400 Subject: [PATCH] Provide execute permissions to entripoint script (#716) ran ```sh git update-index --chmod=+x .github/actions/github-tag-action/entrypoint.sh ``` to overcome `permission denied` error at runtime [SOURCE](https://github.com/orgs/community/discussions/26239) --- .../actions/github-tag-action/entrypoint.sh | 20 ++++++++----------- .../{semver.yaml => version-bump.yaml} | 0 2 files changed, 8 insertions(+), 12 deletions(-) rename .github/workflows/{semver.yaml => version-bump.yaml} (100%) diff --git a/.github/actions/github-tag-action/entrypoint.sh b/.github/actions/github-tag-action/entrypoint.sh index c8335e5f1..9964c7236 100755 --- a/.github/actions/github-tag-action/entrypoint.sh +++ b/.github/actions/github-tag-action/entrypoint.sh @@ -76,11 +76,11 @@ 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*) + *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)" ;; - *branch*) + *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)" ;; @@ -88,8 +88,6 @@ case "$tag_context" in exit 1;; esac -echo "tag_context=$tag_context" - # if there are none, start tags at INITIAL_VERSION if [ -z "$tag" ] then @@ -112,11 +110,9 @@ fi # get current commit hash for tag tag_commit=$(git rev-list -n 1 "$tag") -echo "tag_commit=$tag_commit" # get current commit hash commit=$(git rev-parse HEAD) -echo "commit=$commit" if [ "$tag_commit" == "$commit" ] then @@ -134,22 +130,22 @@ case "$log" in *$major_string_token* ) new=$(semver -i major "$tag"); part="major";; *$minor_string_token* ) new=$(semver -i minor "$tag"); part="minor";; *$patch_string_token* ) new=$(semver -i patch "$tag"); part="patch";; - *$none_string_token* ) + *$none_string_token* ) echo "Default bump was set to none. Skipping..." setOutput "new_tag" "$tag" setOutput "tag" "$tag" exit 0;; - * ) + * ) if [ "$default_semvar_bump" == "none" ] then echo "Default bump was set to none. Skipping..." setOutput "new_tag" "$tag" setOutput "tag" "$tag" - exit 0 - else + exit 0 + else new=$(semver -i "${default_semvar_bump}" "$tag") - part=$default_semvar_bump - fi + part=$default_semvar_bump + fi ;; esac diff --git a/.github/workflows/semver.yaml b/.github/workflows/version-bump.yaml similarity index 100% rename from .github/workflows/semver.yaml rename to .github/workflows/version-bump.yaml