File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -8,23 +8,24 @@ create_release(){
88 local APP_VERSION=" $3 "
99 local CURRENT_BRANCH=" $4 "
1010 local DESC=" $5 "
11- local PAYLOAD=' {
12- "tag_name": "%s",
13- "target_commitish": "%s",
14- "name": "%s",
15- "body": "%s",
11+ local PAYLOAD=$( echo ' {}' | jq --arg tag_name " $APP_VERSION " \
12+ --arg target_commitish " $CURRENT_BRANCH " \
13+ --arg body " $DESC " ' {
14+ $tag_name,
15+ $target_commitish,
16+ $tag_name,
17+ $body,
1618 "draft": false,
1719 "prerelease": true
18- }'
19- local PAYLOAD=$( printf " $PAYLOAD " $APP_VERSION $CURRENT_BRANCH $APP_VERSION " $DESC " )
20+ }' )
2021 (curl -s -X POST -w ' %{stderr}%{http_code}\n%{stdout}\n' \
2122 " https://api.github.com/repos/${USERNAME} /${REPOSITORY} /releases?access_token=$REPO_TOKEN " \
2223 --data " $PAYLOAD " | \
2324 tee -a /dev/stderr | jq -r ' .id' ) 2> /tmp/stderr 1> /tmp/stdout
2425
2526 if test " $( cat /tmp/stderr | head -n 1) " -ne " 201" ; then
26- echo -e " > Can't create release: \n $( cat /tmp/stderr) " >&2
27- exit 3
27+ echo -e " > Can't create release: \nreq= ${PAYLOAD} \n\nres= $( cat /tmp/stderr) " >&2
28+ exit 10
2829 fi
2930 local RELEASE_ID=$( cat /tmp/stdout)
3031 echo " > Release created with id $RELEASE_ID " >&2
@@ -39,7 +40,7 @@ upload_file(){
3940
4041 if test " $( echo " $OUT " | tail -n 1) " -ne " 201" ; then
4142 echo -e " > Can't upload file: $TARGET_FILE \n $( echo ${OUT} ) " >&2
42- exit 2
43+ exit 11
4344 fi
4445}
4546
@@ -57,7 +58,7 @@ upload_files(){
5758validate_repo_token (){
5859 if [ " $REPO_TOKEN " = " " ] ; then
5960 echo " REPO_TOKEN cannot be empty" >&2
60- exit 4 ;
61+ exit 12 ;
6162 fi
6263}
6364
You can’t perform that action at this time.
0 commit comments