From 33c467d14b714b731d9da2e2c1d036b649e3483e Mon Sep 17 00:00:00 2001 From: Patrick Kurmann Date: Thu, 25 Apr 2024 22:31:08 +0200 Subject: [PATCH 1/2] print found last release tag name --- .github/workflows/publish_package.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish_package.yml b/.github/workflows/publish_package.yml index a6cf3a4..9288f93 100644 --- a/.github/workflows/publish_package.yml +++ b/.github/workflows/publish_package.yml @@ -31,6 +31,8 @@ jobs: RELEASE_NAME=$(echo "$LATEST_RELEASE_OR_PRERELEASE_JSON" | jq -r '.name') RELEASE_IS_PRERELEASE=$(echo "$LATEST_RELEASE_OR_PRERELEASE_JSON" | jq -r '.isPrerelease') RELEASE_VERSION="${RELEASE_TAG_NAME#"v"}" + + echo "Found latest release tag name: $RELEASE_TAG_NAME" REPO_URL="https://github.com/${GITHUB_REPOSITORY}" RELEASE_URL="${REPO_URL}/releases/tag/${RELEASE_TAG_NAME}" From dfc1f8228872a1087bf1fff190f97ed3a8dc06f6 Mon Sep 17 00:00:00 2001 From: Patrick Kurmann Date: Thu, 25 Apr 2024 22:37:48 +0200 Subject: [PATCH 2/2] Update publish_package.yml to exclude drafts when retrieving the latest release or prerelease information --- .github/workflows/publish_package.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/publish_package.yml b/.github/workflows/publish_package.yml index 9288f93..9a241f7 100644 --- a/.github/workflows/publish_package.yml +++ b/.github/workflows/publish_package.yml @@ -24,15 +24,13 @@ jobs: - name: Get latest release or prerelease id: get_release_or_prerelease run: | - RELEASES_JSON=$(gh release list --json tagName,name,isPrerelease) + RELEASES_JSON=$(gh release list --json tagName,name,isPrerelease --exclude-drafts) LATEST_RELEASE_OR_PRERELEASE_JSON=$(echo "$RELEASES_JSON" | jq -r '.[0]') RELEASE_TAG_NAME=$(echo "$LATEST_RELEASE_OR_PRERELEASE_JSON" | jq -r '.tagName') RELEASE_NAME=$(echo "$LATEST_RELEASE_OR_PRERELEASE_JSON" | jq -r '.name') RELEASE_IS_PRERELEASE=$(echo "$LATEST_RELEASE_OR_PRERELEASE_JSON" | jq -r '.isPrerelease') RELEASE_VERSION="${RELEASE_TAG_NAME#"v"}" - - echo "Found latest release tag name: $RELEASE_TAG_NAME" REPO_URL="https://github.com/${GITHUB_REPOSITORY}" RELEASE_URL="${REPO_URL}/releases/tag/${RELEASE_TAG_NAME}"