Created
February 17, 2023 06:19
-
-
Save skalahonza/26a50586b13c6d6b95966fcff8a2aaa9 to your computer and use it in GitHub Desktop.
This script is designed to be used in GitHub Actions workflows to set version-related environment variables based on the event that triggered the workflow. If the workflow was triggered by a tag event, the script sets the RELEASE_VERSION environment variable to the commit SHA and tag name separated by a semicolon. Otherwise, the RELEASE_VERSION …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Set Release Version | |
run: | | |
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then | |
echo "RELEASE_VERSION=${GITHUB_SHA};${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
else | |
echo "RELEASE_VERSION=${GITHUB_SHA}" >> $GITHUB_ENV | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment