Skip to content

Commit

Permalink
feat: Release links
Browse files Browse the repository at this point in the history
  • Loading branch information
shencangsheng committed Sep 15, 2022
1 parent 6dcb330 commit efd10a9
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions post-gitlab-release-links-14.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,42 @@

set -e

name=$1
url=$2
file_path=$3
name=
file_path=
url=
link_type="other"

while getopts "n:p:u:t:h" opt; do
case $opt in
n)
name=$OPTARG
;;
p)
file_path=$OPTARG
;;
u)
url=$OPTARG
;;
t)
link_type=$OPTARG
;;
h)
echo "Examples:"
echo "bash post-gitlab-release-links-14.sh -n dist -p './dist' -u 'https://example.com' -t 'package'"
echo ""
exit 0
;;
*)
echo "there is unrecognized parameter."
;;
esac
done

set -u

curl --request POST "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases/${CI_COMMIT_TAG}/assets/links" \
--header "PRIVATE-TOKEN: ${ACCESS_TOKEN}" \
--data name="${name}" \
--data filepath="${file_path}" \
--data url="${url}" \
--data filepath="${file_path}"
--data type="${type}"

0 comments on commit efd10a9

Please sign in to comment.