Skip to content

Commit 65b32d4

Browse files
authoredSep 17, 2024
fix: fix cargo release tag checkout (#2902)
1 parent 94c0956 commit 65b32d4

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed
 

‎.github/workflows/cargo-publish.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,19 @@ jobs:
3333
- uses: Swatinem/rust-cache@v2
3434
with:
3535
workspaces: rust
36-
- name: Checkout specified tag
36+
- name: Verify and checkout specified tag
3737
if: github.event_name == 'workflow_dispatch'
38-
run: git checkout ${{ github.event.inputs.tag }}
38+
run: |
39+
git fetch --all --tags
40+
if git rev-parse ${{ github.event.inputs.tag }} >/dev/null 2>&1; then
41+
git checkout ${{ github.event.inputs.tag }}
42+
echo "Successfully checked out tag ${{ github.event.inputs.tag }}"
43+
else
44+
echo "Error: Tag ${{ github.event.inputs.tag }} does not exist"
45+
echo "Available tags:"
46+
git tag -l
47+
exit 1
48+
fi
3949
- name: Install dependencies
4050
run: |
4151
sudo apt update

0 commit comments

Comments
 (0)