Skip to content
Snippets Groups Projects
Commit 7be16917 authored by Administrator's avatar Administrator Committed by Florian Uhlig
Browse files

Fail script in case of invalid token

parent 145084dc
No related branches found
No related tags found
1 merge request!1906Fail script in case of invalid token
Pipeline #30971 passed
......@@ -151,6 +151,14 @@ function generate_file_list() {
function generate_comment() {
# Fail the test if token isn't valid
MRINFO=$(curl -s --request GET --header "PRIVATE-TOKEN: $COMMENT_TOKEN" "https://git.cbm.gsi.de/api/v4/projects/$CI_MERGE_REQUEST_PROJECT_ID/merge_requests/$CI_MERGE_REQUEST_IID")
MRINFO_1=$(echo $MRINFO | grep project_id)
if [[ -z $MRINFO_1 ]]; then
echo "Invalid token. Stop execution"
exit 1
fi
# Get Information about the MR in JSON format
# Check if the returned string contains the signature that the CodeOwners label is set
# Only create GitLab comment if there is no comment yet (CodeOwners label not set)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment