Spaces:
Paused
Paused
Mirrowel commited on
Commit ·
c350819
1
Parent(s): ce13f06
fix: Enhance git-cliff installation with error handling for asset URL retrieval
Browse files- .github/workflows/build.yml +12 -2
.github/workflows/build.yml
CHANGED
|
@@ -106,9 +106,19 @@ jobs:
|
|
| 106 |
|
| 107 |
- name: Install git-cliff
|
| 108 |
shell: bash
|
|
|
|
|
|
|
| 109 |
run: |
|
| 110 |
-
|
| 111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
sudo mv git-cliff-*/git-cliff /usr/local/bin/
|
| 113 |
|
| 114 |
- name: Prepare git-cliff config
|
|
|
|
| 106 |
|
| 107 |
- name: Install git-cliff
|
| 108 |
shell: bash
|
| 109 |
+
env:
|
| 110 |
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 111 |
run: |
|
| 112 |
+
API_RESPONSE=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/orhun/git-cliff/releases/latest)
|
| 113 |
+
LATEST_CLIFF_URL=$(echo "$API_RESPONSE" | jq -r '.assets[] | select(.name | endswith("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url')
|
| 114 |
+
|
| 115 |
+
if [ -z "$LATEST_CLIFF_URL" ]; then
|
| 116 |
+
echo "::error::Could not find git-cliff asset URL."
|
| 117 |
+
echo "API Response: $API_RESPONSE"
|
| 118 |
+
exit 1
|
| 119 |
+
fi
|
| 120 |
+
|
| 121 |
+
curl -L "$LATEST_CLIFF_URL" | tar xz
|
| 122 |
sudo mv git-cliff-*/git-cliff /usr/local/bin/
|
| 123 |
|
| 124 |
- name: Prepare git-cliff config
|