Skip to content

Commit

Permalink
fix: fix cargo release tag checkout (#2902)
Browse files Browse the repository at this point in the history
  • Loading branch information
LuQQiu authored Sep 17, 2024
1 parent 94c0956 commit 65b32d4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/cargo-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,19 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
- name: Checkout specified tag
- name: Verify and checkout specified tag
if: github.event_name == 'workflow_dispatch'
run: git checkout ${{ github.event.inputs.tag }}
run: |
git fetch --all --tags
if git rev-parse ${{ github.event.inputs.tag }} >/dev/null 2>&1; then
git checkout ${{ github.event.inputs.tag }}
echo "Successfully checked out tag ${{ github.event.inputs.tag }}"
else
echo "Error: Tag ${{ github.event.inputs.tag }} does not exist"
echo "Available tags:"
git tag -l
exit 1
fi
- name: Install dependencies
run: |
sudo apt update
Expand Down

0 comments on commit 65b32d4

Please sign in to comment.