Created
March 12, 2023 20:36
-
-
Save mirismaili/d87be835d380572aa35e6b20d033cb65 to your computer and use it in GitHub Desktop.
Auto tag current version (from package.json) after commit
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
#!/bin/bash | |
# Auto-tag version (if already not existed): | |
version=$(grep -oP '\"version\"\s*:\s*\"\K\d+\.\d+\.\d+' package.json) # extract `version` from "package.json". ex: 2.0.4 | |
git tag v$version 2>/dev/null # ex: `git tag v2.0.4` (and ignore possible error) | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment