File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 33
44# Path to file containing blob contents
55path=" ${1} "
6- base64 -i " ${path} "
76
87# Encode blob contents
98content=$( mktemp )
10- base64 -i " ${path} " | jq --raw-input ' .' > $content
11- cat $content
9+ base64 " ${path} " | tr -d ' \n' | jq --raw-input ' .' > $content
1210
1311# # Generate payload
1412payload=$( mktemp )
1513jq --null-input \
1614 --arg encoding " base64" \
1715 --argfile content " $content " \
1816 ' {"content": $content, "encoding": $encoding}' > $payload
19- cat $payload
2017
2118# Create blob
2219response=$( curl --silent --request POST \
2320 --url https://api.github.com/repos/$GITHUB_REPOSITORY /git/blobs \
2421 --header " authorization: Bearer $GH_TOKEN " \
2522 --header ' content-type: application/json' \
2623 --data @$payload )
27- echo " $response "
2824
29- # # Export environment variables with object ids
30- # echo BLOB_SHA=$( jq -r '.sha' <<< "${response}" ) >> $GITHUB_ENV
25+ # Export environment variables with object ids
26+ echo BLOB_SHA=$( jq -r ' .sha' <<< " ${response}" ) >> $GITHUB_ENV
You can’t perform that action at this time.
0 commit comments