We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 020e5b8 commit 170a5b4Copy full SHA for 170a5b4
1 file changed
.github/scripts/sync-release-to-gitee.sh
@@ -27,14 +27,17 @@ urlencode() {
27
28
gitee_release_id_by_tag() {
29
local tag="$1"
30
- local tag_q tmp code
+ local tag_q tmp code rid
31
tag_q="$(urlencode "${tag}")"
32
tmp="$(mktemp)"
33
code="$(curl -sS -o "${tmp}" -w "%{http_code}" "${API_BASE}/releases/tags/${tag_q}?access_token=${GITEE_TOKEN}")"
34
if [[ "${code}" == "200" ]]; then
35
- jq -r '.id' "${tmp}"
36
- rm -f "${tmp}"
37
- return 0
+ rid="$(jq -r '.id // empty' "${tmp}")"
+ if [[ -n "${rid}" && "${rid}" != "null" ]]; then
+ echo "${rid}"
38
+ rm -f "${tmp}"
39
+ return 0
40
+ fi
41
fi
42
rm -f "${tmp}"
43
return 1
@@ -200,4 +203,3 @@ case "${MODE}" in
200
203
exit 1
201
204
;;
202
205
esac
-
0 commit comments