Delete tags greater than v12.0 #2
Workflow file for this run
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: Delete tags greater than v12.0 | |
on: | |
create: | |
tags: | |
- v* | |
jobs: | |
delete-tag: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Delete tag | |
run: | | |
TAG_NAME=${{ github.ref }} | |
TAG_VERSION=${TAG_NAME#refs/tags/v} | |
MIN_VERSION="12.0" | |
if (( $(echo "$TAG_VERSION > $MIN_VERSION" | bc -l) )); then | |
echo "Deleting tag $TAG_NAME" | |
git tag -d $TAG_NAME | |
git push origin :refs/tags/$TAG_NAME | |
fi |