Files
version_tag/action.sh
Bryce Thorup cdbfa392e0
All checks were successful
Push to main / Reset-Version-Tag (push) Successful in 27s
this should do it
2024-01-02 14:53:46 -07:00

18 lines
504 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
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
# a change