Skip to content

Commit

Permalink
fix: update tag workflow (#1699)
Browse files Browse the repository at this point in the history
* fix: update tag workflow

* update indentation and remove ref
  • Loading branch information
alicejli authored May 23, 2023
1 parent 4ec1b2d commit a988fe7
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/create_additional_release_tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ name: Create additional tags for each release
on:
release:
types: [published]
workflow_dispatch: # If manually triggered, clarify which release to create the additional tags for
inputs:
releaseTag:
description: 'Release Tag'
required: true
workflow_dispatch:

jobs:
build:
Expand All @@ -17,7 +13,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.releaseTag }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Git
Expand All @@ -28,9 +23,13 @@ jobs:
- name: Create additional tags
run: |
ARTIFACT_IDS=('google-cloud-shared-dependencies' 'api-common' 'gax')
for ARTIFACT_ID in "${ARTIFACT_IDS[@]}"
do
VERSION=$(grep "${ARTIFACT_ID}" versions.txt | cut -d':' -f2)
git tag ${ARTIFACT_ID}/$VERSION ${{ github.event.inputs.releaseTag }}
git push origin ${ARTIFACT_ID}/$VERSION
for ARTIFACT_ID in "${ARTIFACT_IDS[@]}"; do
VERSION=$(grep "^${ARTIFACT_ID}:" versions.txt | cut -d':' -f2 | tr -d '[:space:]')
TAG_NAME="${ARTIFACT_ID}/v$VERSION"
if git show-ref --tags | grep -q "refs/tags/$TAG_NAME"; then
echo "Tag $TAG_NAME already exists. Skipping."
continue
fi
git tag $TAG_NAME
git push origin $TAG_NAME
done

0 comments on commit a988fe7

Please sign in to comment.