This commit is contained in:
parent
2e277a7c38
commit
bd3dbca0c7
1 changed files with 9 additions and 5 deletions
|
|
@ -51,17 +51,21 @@ jobs:
|
||||||
REPO="${{ github.repository }}"
|
REPO="${{ github.repository }}"
|
||||||
|
|
||||||
# get or create release
|
# get or create release
|
||||||
RELEASE_ID=$(curl -sf \
|
echo "Looking for release: ${API_BASE}/repos/${REPO}/releases/tags/${TAG}"
|
||||||
-H "Authorization: token ${FORGEJO_TOKEN}" \
|
RESPONSE=$(curl -s -H "Authorization: token ${FORGEJO_TOKEN}" \
|
||||||
"${API_BASE}/repos/${REPO}/releases/tags/${TAG}" | jq -r '.id')
|
"${API_BASE}/repos/${REPO}/releases/tags/${TAG}")
|
||||||
|
echo "Lookup response: ${RESPONSE}"
|
||||||
|
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
|
||||||
|
|
||||||
if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then
|
if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then
|
||||||
echo "Creating release for ${TAG}..."
|
echo "Creating release for ${TAG}..."
|
||||||
RELEASE_ID=$(curl -sf -X POST \
|
RESPONSE=$(curl -s -X POST \
|
||||||
-H "Authorization: token ${FORGEJO_TOKEN}" \
|
-H "Authorization: token ${FORGEJO_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${TAG}\"}" \
|
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${TAG}\"}" \
|
||||||
"${API_BASE}/repos/${REPO}/releases" | jq -r '.id')
|
"${API_BASE}/repos/${REPO}/releases")
|
||||||
|
echo "Create response: ${RESPONSE}"
|
||||||
|
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Release ID: ${RELEASE_ID}"
|
echo "Release ID: ${RELEASE_ID}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue