From b5e90e45a9da7ebfcb4ed2a9b6c79490a522fee5 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Fri, 30 Dec 2022 18:03:02 -0800 Subject: [PATCH] Fix release failure by fetching all tags during checkout Command: for remote in local_repo.remotes: remote.fetch('--tags') Error message: git.exc.GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git fetch -v -- origin --tags stderr: 'fatal: couldn't find remote ref --tags' Before: Fetching the repository /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin [...] After: Fetching the repository /usr/bin/git -c protocol.version=2 fetch --prune --progress --no-recurse-submodules origin [...] --- .github/workflows/release.yml | 2 ++ scripts/make_release.py | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2e08965..7d749a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Install requirements run: | diff --git a/scripts/make_release.py b/scripts/make_release.py index 5ea3a72..9341cd9 100644 --- a/scripts/make_release.py +++ b/scripts/make_release.py @@ -31,11 +31,6 @@ def main(): # git for-each-ref --format="%(refname:short) | %(creatordate)" "refs/tags/*" local_repo = git.Repo(ROOT) - # Fetch tags since `git fetch' is run with --no-tags during actions/checkout. - # git fetch --tags - for remote in local_repo.remotes: - remote.fetch('--tags') - # Sort the tags by version. # git tag --list | sort --reverse --version-sort tags = sorted(