commit-ish doesn't include tags today

gh release --target only accepts a branch ref or a FULL sha hash, it doesn't accept tag names, which surprised us

we tried writing a version where we just supply a sha hash instead of creating a tag and then passing the tag name to the workflow, but workflows can't be run on a sha hash, they can only be run on tags and branches.

so we reverted to the original strategy of creating a tag locally and pushing it, and then starting the workflow with that tag, but then not referencing the tag for gh release, hoping that `${{github.sha}}` will work instead.
This commit is contained in:
Arya Irani 2024-05-15 18:07:42 -04:00 committed by GitHub
parent 2caeffd2ea
commit 34e14899c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ jobs:
gh release create "release/${{inputs.version}}" \
--repo unisonweb/unison \
--target "${{github.ref}}" \
--target "${{github.sha}}" \
--generate-notes \
--notes-start-tag "${prev_tag}" \
\

View File

@ -38,7 +38,7 @@ if ! [[ "$1" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] ; then
fi
version="${1}"
target=${2:-origin/trunk}
src=${2:-origin/trunk}
tag="release/$version"
echo "Creating release in unison-local-ui."
@ -50,7 +50,7 @@ gh release create "release/${version}" \
echo "Kicking off release workflow in unisonweb/unison"
# Make sure our origin/trunk ref is up to date, since that's usually what gets tagged.
git fetch origin trunk
git tag "${tag}" "${target}"
git tag "${tag}" "${src}"
git push origin "${tag}"
gh workflow run release --repo unisonweb/unison \
--ref "${tag}" \