Skip to content

Commit d74057d

Browse files
authored
Update release.yml
Signed-off-by: Hudson Xing <77495133+harvenstar@users.noreply.github.com>
1 parent e7073c9 commit d74057d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,22 @@ jobs:
3333
- name: Checkout code
3434
uses: actions/checkout@v4
3535

36+
- name: Delete existing tag (if any)
37+
uses: actions/github-script@v7
38+
with:
39+
script: |
40+
const tag = '${{ github.event.inputs.version }}';
41+
try {
42+
await github.git.deleteRef({
43+
owner: context.repo.owner,
44+
repo: context.repo.repo,
45+
ref: `tags/${tag}`
46+
});
47+
console.log(`Deleted existing tag: ${tag}`);
48+
} catch (e) {
49+
console.log(`Tag ${tag} does not exist or already deleted.`);
50+
}
51+
3652
# Step 2: Download the build artifact from your 'Build' workflow.
3753
# This finds the latest successful run on the specified branch and downloads the artifact.
3854
- name: Download artifact from build workflow

0 commit comments

Comments
 (0)