Skip to content

Commit

Permalink
chore: update tag creation condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Mastersam07 committed Feb 18, 2025
1 parent 7d747bb commit 3d984fa
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -33,12 +35,16 @@ jobs:
- name: Package VS Code Extension
run: vsce package

- name: Create Git Tag
- name: Create Git Tag (If Not Exists)
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -f ${{ inputs.version }}
git push origin -f ${{ inputs.version }}
if git rev-parse ${{ inputs.version }} >/dev/null 2>&1; then
echo "Tag ${{ inputs.version }} already exists. Skipping..."
else
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag ${{ inputs.version }} HEAD -m "Release ${{ inputs.version }}"
git push origin ${{ inputs.version }}
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
Expand Down

0 comments on commit 3d984fa

Please sign in to comment.