mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2025-12-08 14:22:40 +01:00
@@ -17,6 +17,15 @@ API_VERSION=v3
|
|||||||
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
|
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
|
||||||
AUTH_HEADER="Authorization: token ${GITHUB_TOKEN}"
|
AUTH_HEADER="Authorization: token ${GITHUB_TOKEN}"
|
||||||
|
|
||||||
|
main(){
|
||||||
|
local files
|
||||||
|
|
||||||
|
if [ "$#" -eq 0 ]; then
|
||||||
|
echo "Must pass files to be uploaded..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
files=( "$@" )
|
||||||
|
|
||||||
# Validate the GitHub token.
|
# Validate the GitHub token.
|
||||||
curl -o /dev/null -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${GITHUB_REPOSITORY}" || { echo "Error: Invalid repo, token or network issue!"; exit 1; }
|
curl -o /dev/null -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${GITHUB_REPOSITORY}" || { echo "Error: Invalid repo, token or network issue!"; exit 1; }
|
||||||
|
|
||||||
@@ -25,4 +34,8 @@ tag_response=$(curl -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${
|
|||||||
tag_name=$(echo $tag_response | jq -e --raw-output .tag_name)
|
tag_name=$(echo $tag_response | jq -e --raw-output .tag_name)
|
||||||
tag_id=$(echo $tag_response | jq -e --raw-output .id)
|
tag_id=$(echo $tag_response | jq -e --raw-output .id)
|
||||||
|
|
||||||
echo "tag name: ${tag_name} tag id: ${tag_id}"
|
echo "Uploading files: ${files[@]}"
|
||||||
|
echo "For tag name: ${tag_name} tag id: ${tag_id}"
|
||||||
|
}
|
||||||
|
|
||||||
|
main $@
|
||||||
|
|||||||
Reference in New Issue
Block a user