From 699b3520fcb2167641b3a46b365a3e60554d0b5e Mon Sep 17 00:00:00 2001 From: skudasov Date: Wed, 11 Sep 2024 21:10:11 +0200 Subject: [PATCH] fix ci --- .github/workflows/release-go-module.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-go-module.yml b/.github/workflows/release-go-module.yml index ea9abca24..90f53f703 100644 --- a/.github/workflows/release-go-module.yml +++ b/.github/workflows/release-go-module.yml @@ -25,7 +25,9 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - fetch-tags: true + - name: Fetch all tags + run: | + git fetch --tags - name: Extract Package Name from Tag id: extract_package_name run: | @@ -48,7 +50,7 @@ jobs: # Find the latest tag for the same package that is not the current tag LAST_TAG=$(git describe --abbrev=0 --match "$PACKAGE_NAME/v*" --tags $(git rev-list --tags --skip=1 --max-count=1)) - echo "Last tag: $LAST_TAG" + echo "Last tag: ${LAST_TAG}" # If no previous tag is found, use the initial commit as the reference if [ -z "$LAST_TAG" ]; then @@ -58,6 +60,7 @@ jobs: # Extract the version part of the last tag LAST_TAG_VERSION=$(echo "$LAST_TAG" | cut -d'/' -f2) echo "Last tag version: $LAST_TAG_VERSION" + echo "LAST_TAG_VERSION=${LAST_TAG_VERSION}" >> $GITHUB_ENV # Get the commits between the last tag and the current tag COMMITS=$(git log "$LAST_TAG..$PACKAGE_NAME/$VERSION" --pretty=format:"- %s (%h)") @@ -78,13 +81,13 @@ jobs: run: | go install golang.org/x/exp/cmd/gorelease@latest - name: Run gorelease to check for breaking changes - working-directory: tools/breakingchanges + working-directory: ${{ env.PACKAGE_NAME }} id: check_breaking_changes run: | set +e # Disable exit on error to capture output even if the command fails - echo "Last tag version: ${LAST_TAG_VERSION}" + echo "Last tag version: ${{ env.LAST_TAG_VERSION }}" echo "Current tag version: ${VERSION}" - BREAKING_CHANGES=$(gorelease -base=${LAST_TAG_VERSION} -version=${VERSION} 2>&1) + BREAKING_CHANGES=$(gorelease -base=${{ env.LAST_TAG_VERSION }} -version=${VERSION} 2>&1) echo "Breaking changes: ${BREAKING_CHANGES}" set -e # Re-enable exit on error for the subsequent steps echo "BREAKING_CHANGES<> $GITHUB_ENV