Fixed script

This commit is contained in:
Marcus Noble 2020-06-07 13:32:25 +01:00
parent cd238e5415
commit 34f4834977
2 changed files with 4 additions and 8 deletions

View File

@ -6,6 +6,6 @@ ADD giteaPR.sh /
RUN chmod +x /giteaPR.sh
ENV GITEA_HOST=git.cluster.fun
ENV ACCESS_KEY=
ENV ACCESS_TOKEN=
ENTRYPOINT [ "/giteaPR.sh" ]

10
giteaPR.sh Normal file → Executable file
View File

@ -4,8 +4,8 @@ REPO=$1
SHA=$2
STATE=$3
CONTEXT=${CONTEXT:-Tekton}
DESCRIPTION=${DESCRIPTION:-PR Pipeline}
CONTEXT=${CONTEXT:-CI}
DESCRIPTION=${DESCRIPTION:-"PR Checks..."}
echo "Repo: ${REPO}"
echo "SHA: ${SHA}"
@ -14,8 +14,4 @@ echo "State: ${STATE}"
curl -X "POST" \
"https://${GITEA_HOST}/api/v1/repos/${REPO}/statuses/${SHA}?access_token=${ACCESS_TOKEN}" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"state": "'$STATE'",
"context": "'$CONTEXT'",
"description": "'$DESCRIPTION'"
}'
-d $'{"state": "'"${STATE}"'","context": "'"${CONTEXT}"'","description": "'"${DESCRIPTION}"'"}'