Skip to content

Commit

Permalink
Update entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
HidetoNiwa authored Jan 27, 2022
1 parent a76943e commit 041699b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/actions/latex/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ res=`curl -H "Authorization: token $GITHUB_TOKEN" -X POST https://api.github.com
\"prerelease\": false
}"`

# extract release id
rel_id=`echo ${res} | python3 -c 'import json,sys;print(json.load(sys.stdin)["id"])'`
release_id=$(echo $res | jq '.id')
file_path="./main.pdf"

# upload built pdf
curl -H "Authorization: token $GITHUB_TOKEN" -X POST https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/${rel_id}/assets?name=main.pdf\
--header 'Content-Type: application/pdf'\
--upload-file main.pdf
ls -la

response=$(curl -X POST -H "Content-Type: $(file -b --mime-type $file_path)"\
-H "Authorization: token $GITHUB_TOKEN" --data-binary @$file_path \
"https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/$release_id/assets?name=$(basename $file_path)")

0 comments on commit 041699b

Please sign in to comment.