Skip to content

Commit a488080

Browse files
committed
fix(ci): make release workflow idempotent
1 parent 532c8ef commit a488080

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ jobs:
1818
env:
1919
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2020
run: |
21-
gh release create "$GITHUB_REF_NAME" \
22-
--repo="$GITHUB_REPOSITORY" \
23-
--title="$GITHUB_REF_NAME" \
24-
--generate-notes
21+
if gh release view "$GITHUB_REF_NAME" --repo="$GITHUB_REPOSITORY" >/dev/null 2>&1; then
22+
gh release edit "$GITHUB_REF_NAME" \
23+
--repo="$GITHUB_REPOSITORY" \
24+
--title="$GITHUB_REF_NAME" \
25+
--latest
26+
else
27+
gh release create "$GITHUB_REF_NAME" \
28+
--repo="$GITHUB_REPOSITORY" \
29+
--title="$GITHUB_REF_NAME" \
30+
--generate-notes
31+
fi

0 commit comments

Comments
 (0)