Utilisation de --rawfile pour l'injection du corps de texte de la release
This commit is contained in:
parent
356dc6d16c
commit
c77c020be0
|
@ -91,7 +91,7 @@ function retrieve_commitish_target {
|
||||||
function create_release {
|
function create_release {
|
||||||
local payload={}
|
local payload={}
|
||||||
|
|
||||||
payload=$(json_set "$payload" body "\"$GITEA_RELEASE_BODY\"")
|
payload=$(json_set "$payload" body "$GITEA_RELEASE_BODY" true)
|
||||||
payload=$(json_set "$payload" draft $GITEA_RELEASE_IS_DRAFT)
|
payload=$(json_set "$payload" draft $GITEA_RELEASE_IS_DRAFT)
|
||||||
payload=$(json_set "$payload" name "\"$GITEA_RELEASE_VERSION\"")
|
payload=$(json_set "$payload" name "\"$GITEA_RELEASE_VERSION\"")
|
||||||
payload=$(json_set "$payload" prerelease $GITEA_RELEASE_IS_PRERELEASE)
|
payload=$(json_set "$payload" prerelease $GITEA_RELEASE_IS_PRERELEASE)
|
||||||
|
@ -113,7 +113,16 @@ function json_set {
|
||||||
local data=$1
|
local data=$1
|
||||||
local key=$2
|
local key=$2
|
||||||
local value=$3
|
local value=$3
|
||||||
|
local use_raw_file=$4
|
||||||
|
|
||||||
|
if [ "$use_raw_file" != "true" ]; then
|
||||||
echo $data | jq -cr --argjson v "$value" --arg k "$key" '.[$k] = $v'
|
echo $data | jq -cr --argjson v "$value" --arg k "$key" '.[$k] = $v'
|
||||||
|
else
|
||||||
|
local tmpfile=$(mktemp)
|
||||||
|
echo "$value" > "$tmpfile"
|
||||||
|
echo $data | jq -cr --rawfile v "$tmpfile" --arg k "$key" '.[$k] = $v'
|
||||||
|
rm -f "$tmpfile"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function upload_release_attachments {
|
function upload_release_attachments {
|
||||||
|
|
Loading…
Reference in New Issue