Skip to content

Commit

Permalink
Provide execute permissions to entripoint script (#716)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
elliotmjackson committed Nov 4, 2022
1 parent a81fb4b commit 18bd6b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/actions/github-tag-action/entrypoint.sh
Expand Up @@ -76,20 +76,18 @@ 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)"
;;
* ) echo "Unrecognised context"
exit 1;;
esac

echo "tag_context=$tag_context"

# if there are none, start tags at INITIAL_VERSION
if [ -z "$tag" ]
then
Expand All @@ -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
Expand All @@ -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

Expand Down
File renamed without changes.

0 comments on commit 18bd6b7

Please sign in to comment.