Skip to content

Commit 7cecd16

Browse files
authored
Update publish-acs-esp-miner-firmware.yml
1 parent 4341c25 commit 7cecd16

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/publish-acs-esp-miner-firmware.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,14 @@ jobs:
4848
4949
- name: Download release asset
5050
run: |
51-
URL="https://github.com/${REPO}/releases/download/${{ github.event.release.tag_name || 'latest' }}/$ASSET_NAME"
51+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
52+
# Get the latest release tag from GitHub API
53+
LATEST_TAG=$(curl -s "https://api.github.com/repos/${REPO}/releases/latest" | jq -r '.tag_name')
54+
echo "Latest release tag: $LATEST_TAG"
55+
URL="https://github.com/${REPO}/releases/download/$LATEST_TAG/$ASSET_NAME"
56+
else
57+
URL="https://github.com/${REPO}/releases/download/${{ github.event.release.tag_name }}/$ASSET_NAME"
58+
fi
5259
echo "Downloading $URL"
5360
curl -L -o "$ASSET_NAME" "$URL"
5461

0 commit comments

Comments
 (0)