From 34e14899c4e0ecee08a6e1e40a96bc287a6fa116 Mon Sep 17 00:00:00 2001 From: Arya Irani <538571+aryairani@users.noreply.github.com> Date: Wed, 15 May 2024 18:07:42 -0400 Subject: [PATCH] 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. --- .github/workflows/release.yaml | 2 +- scripts/make-release.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4cac97eac..6b894f0de 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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}" \ \ diff --git a/scripts/make-release.sh b/scripts/make-release.sh index 0246584ae..19a2b9978 100755 --- a/scripts/make-release.sh +++ b/scripts/make-release.sh @@ -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}" \