Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
accounting for multiple github events
Browse files Browse the repository at this point in the history
  • Loading branch information
Mbaoma committed Jun 7, 2023
1 parent 8432506 commit a963c30
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ runs:
echo "Event payload: ${{ toJson(github.event_name) }}"
#for release events, the tag name is available as github.event.release.tag_name, long SHA as github.sha and short SHA as github.sha_short
if [ "${{ github.event_name }}" = "release" ]; then
export TAG_NAME="${{ github.event.release.tag_name }}"
export COMMIT_TAG="${TAG_NAME#refs/tags/}"
export SHA="${{ github.sha }}"
export SHORT_SHA="${SHA:0:7}"
# if [ "${{ github.event_name }}" = "release" ]; then
# export TAG_NAME="${{ github.event.release.tag_name }}"
# export COMMIT_TAG="${TAG_NAME#refs/tags/}"
# export SHA="${{ github.sha }}"
# export SHORT_SHA="${SHA:0:7}"
echo "Release Version ${COMMIT_TAG}"
echo "Short SHA ${SHORT_SHA}"
echo "Long SHA ${SHA}"
# echo "Release Version ${COMMIT_TAG}"
# echo "Short SHA ${SHORT_SHA}"
# echo "Long SHA ${SHA}"
else
# else
#for commits, the tag name is available as github.ref, long SHA as github.sha and short SHA as github.sha_short
if [ -z "${IMAGE_TAG}" ]; then
BRANCH_NAME="${BRANCH_NAME#refs/tags/}"
Expand All @@ -104,7 +104,7 @@ runs:
echo "Short SHA ${SHORT_SHA}"
echo "Long SHA ${SHA}"
fi
fi
# fi
# convert the image name to lowercase
export IMAGE_NAME=$(echo "${IMAGE_NAME}" | tr '[:upper:]' '[:lower:]')
Expand Down

0 comments on commit a963c30

Please sign in to comment.