diff --git a/.github/scripts/update_dependency_changes.py b/.github/scripts/update_dependency_changes.py index 02ab623ff8..060e945486 100644 --- a/.github/scripts/update_dependency_changes.py +++ b/.github/scripts/update_dependency_changes.py @@ -26,13 +26,13 @@ def normalize_version(version): def check_tag_exists(tag): - """Check if a git tag exists.""" + """Check if a git tag exists on the remote.""" result = subprocess.run( - ["git", "tag", "-l", tag], + ["git", "ls-remote", "--tags", "origin", tag], capture_output=True, text=True, ) - return result.returncode == 0 and tag in result.stdout.strip().split("\n") + return result.returncode == 0 and result.stdout.strip() != "" def bump_patch_if_released(version, tag_exists_fn=None): diff --git a/.github/workflows/nuget-packages-version-change-detector.yml b/.github/workflows/nuget-packages-version-change-detector.yml index 4ed7fad8de..45dba3332b 100644 --- a/.github/workflows/nuget-packages-version-change-detector.yml +++ b/.github/workflows/nuget-packages-version-change-detector.yml @@ -44,10 +44,8 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 1 - - name: Fetch base branch and tags - run: | - git fetch origin ${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }} --depth=1 - git fetch --tags origin + - name: Fetch base branch + run: git fetch origin ${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }} --depth=1 - uses: actions/setup-python@v5 with: