File tree 1 file changed +10
-11
lines changed
1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,7 @@ name: Create additional tags for each release
3
3
on :
4
4
release :
5
5
types : [published]
6
- workflow_dispatch : # If manually triggered, clarify which release to create the additional tags for
7
- inputs :
8
- releaseTag :
9
- description : ' Release Tag'
10
- required : true
6
+ workflow_dispatch :
11
7
12
8
jobs :
13
9
build :
17
13
- name : Checkout code
18
14
uses : actions/checkout@v3
19
15
with :
20
- ref : ${{ github.event.inputs.releaseTag }}
21
16
token : ${{ secrets.GITHUB_TOKEN }}
22
17
23
18
- name : Set up Git
28
23
- name : Create additional tags
29
24
run : |
30
25
ARTIFACT_IDS=('google-cloud-shared-dependencies' 'api-common' 'gax')
31
- for ARTIFACT_ID in "${ARTIFACT_IDS[@]}"
32
- do
33
- VERSION=$(grep "${ARTIFACT_ID}" versions.txt | cut -d':' -f2)
34
- git tag ${ARTIFACT_ID}/$VERSION ${{ github.event.inputs.releaseTag }}
35
- git push origin ${ARTIFACT_ID}/$VERSION
26
+ for ARTIFACT_ID in "${ARTIFACT_IDS[@]}"; do
27
+ VERSION=$(grep "^${ARTIFACT_ID}:" versions.txt | cut -d':' -f2 | tr -d '[:space:]')
28
+ TAG_NAME="${ARTIFACT_ID}/v$VERSION"
29
+ if git show-ref --tags | grep -q "refs/tags/$TAG_NAME"; then
30
+ echo "Tag $TAG_NAME already exists. Skipping."
31
+ continue
32
+ fi
33
+ git tag $TAG_NAME
34
+ git push origin $TAG_NAME
36
35
done
You can’t perform that action at this time.
0 commit comments