From 732dd371e91f3bcda7ecfc48e0981ea4ea491c2b Mon Sep 17 00:00:00 2001 From: Ioannis Tsiakkas Date: Sat, 24 Feb 2024 13:20:45 +0200 Subject: [PATCH] update git fetch --- .github/workflows/go.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ca82102..ac2b321 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -44,6 +44,8 @@ jobs: # if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Fetch Tags run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* @@ -51,8 +53,8 @@ jobs: - name: Get commits since last tag id: get_commits run: | - LATEST_TAG=$(git describe --tags --abbrev=0) - if [ -z "$LATEST_TAG" ]; then + LATEST_TAG=$(git describe --tags --abbrev=0 --always) + if [ -z "$LATEST_TAG" ] || [[ "$LATEST_TAG" == *"$GITHUB_SHA"* ]]; then LATEST_TAG=$(git rev-list --max-parents=0 HEAD) fi COMMIT_MESSAGES=$(git log $LATEST_TAG..HEAD --pretty=format:"%h - %s")