Files
version_tag/action.sh
T
bryce 6e2ea2c2ad
Push to main / Reset-Version-Tag (push) Successful in 6s
test
2026-05-27 13:28:35 -06:00

26 lines
711 B
Bash
Executable File

apt update
apt install jq -y
git config --global user.email "cloud+git+runner@thorup.us"
git config --global user.name "Git runner"
CURRENT_VERSION=$(jq -r .version package.json)
echo $CURRENT_VERSION
git checkout $CURRENT_VERSION
CURRENT_VERSION=$INPUT_PREFIX$CURRENT_VERSION
ls
if [[ $INPUT_FORCE_OVERRIDE == true ]];
then
git tag -d $CURRENT_VERSION || true
git push --delete origin $CURRENT_VERSION || true
fi
PREVIOUS_VERSIONS=$(git tag -l)
echo $PREVIOUS_VERSIONS
if [[ $PREVIOUS_VERSIONS != *$CURRENT_VERSION* ]];
then
echo "Tag for version $CURRENT_VERSION not found. Creating tag..."
git tag -a -m "Version $CURRENT_VERSION" $CURRENT_VERSION
git push --follow-tags
echo "Tag created."
fi