diff --git a/.github/workflows/pr-version-bump.yml b/.github/workflows/pr-version-bump.yml index 2bbf6a12f..507c508e2 100644 --- a/.github/workflows/pr-version-bump.yml +++ b/.github/workflows/pr-version-bump.yml @@ -12,6 +12,10 @@ jobs: if: ${{ github.event.pull_request.merged == true }} steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + fetch-depth: 0 + fetch-tags: true - name: Fetch all tags run: git fetch --tags --force @@ -19,7 +23,7 @@ jobs: - name: Fetch tags from main id: get_latest_tag run: | - git fetch origin main --tags + git fetch origin main --tags --force latest_tag=$(git tag --list --sort=-v:refname --merged | head -n 1) echo "::set-output name=latest_tag::$latest_tag" echo "Latest tag: $latest_tag" diff --git a/.github/workflows/release-branch-creation.yml b/.github/workflows/release-branch-creation.yml index d162d6259..dc1e58e9f 100644 --- a/.github/workflows/release-branch-creation.yml +++ b/.github/workflows/release-branch-creation.yml @@ -11,6 +11,10 @@ jobs: if: startsWith(github.ref, 'refs/heads/release/') && !contains(github.ref, '/') steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + fetch-depth: 0 + fetch-tags: true - name: Install npm run: sudo apt-get install -y npm @@ -19,7 +23,7 @@ jobs: - name: Fetch latest tag id: latest_tag run: | - git fetch --tags + git fetch --tags --force latest_tag=$(git tag --list --sort=-v:refname --merged | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1) if [ -z "$latest_tag" ]; then echo "No previous tags found, starting with v0.1.0"