Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 30560b1

Browse filesBrowse files
committed
fix(release): check remote tags using git ls-remote to prevent already exists error
1 parent 95c7774 commit 30560b1
Copy full SHA for 30560b1

1 file changed

+2-4Lines changed: 2 additions & 4 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/create_additional_release_tag.yaml‎

Copy file name to clipboardExpand all lines: .github/workflows/create_additional_release_tag.yaml
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@ jobs:
2020
run: |
2121
git config --local user.email "action@github.com"
2222
git config --local user.name "GitHub Action"
23-
- name: Fetch all tags
24-
run: git fetch --tags
2523
- name: Create additional tags
2624
shell: bash
2725
run: |
2826
ARTIFACT_IDS=('google-cloud-shared-dependencies' 'api-common' 'gax' 'google-cloud-bigtable')
2927
for ARTIFACT_ID in "${ARTIFACT_IDS[@]}"; do
3028
VERSION=$(grep "^${ARTIFACT_ID}:" versions.txt | cut -d':' -f2 | tr -d '[:space:]')
3129
TAG_NAME="${ARTIFACT_ID}/v$VERSION"
32-
if git show-ref --tags | grep -q "refs/tags/$TAG_NAME"; then
33-
echo "Tag $TAG_NAME already exists. Skipping."
30+
if git ls-remote --tags origin | grep -q "refs/tags/$TAG_NAME"; then
31+
echo "Tag $TAG_NAME already exists on remote. Skipping."
3432
continue
3533
fi
3634
git tag $TAG_NAME

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.