dotfiles/bin/tag-release
Oliver Davies 47e2189487 fix(tag-release): accept no arguments
HEAD should be used as the default value if no value is passed for the
SHA value.
2023-05-16 19:55:31 +01:00

11 lines
221 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
commit_sha="${1:-HEAD}"
tag="$(date '+%Y-%m-%d-%H.%M.%S')"
# Tag the appropriate commit and push to the remote.
git tag "${tag}" "${commit_sha}"
git push origin "refs/tags/${tag}"