diff --git a/contrib/fedora/rpm/release.sh b/contrib/fedora/rpm/release.sh index 5a7e0c16de..ff18cc5b00 100755 --- a/contrib/fedora/rpm/release.sh +++ b/contrib/fedora/rpm/release.sh @@ -559,9 +559,11 @@ if [[ $GITLAB_TOKEN == "" ]]; then fi # This step is not necessary for authentication, we use it only to provide a meaningful error message. -curl --request GET --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \ - "https://gitlab.freedesktop.org/api/v4/personal_access_tokens/self" &>/dev/null \ - || die "failed to authenticate at gitlab.freedesktop.org with the private token" +GITLAB_USER_ID=$(curl --request GET --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \ + "https://gitlab.freedesktop.org/api/v4/personal_access_tokens/self" 2>/dev/null | jq ".user_id" || true) +if [ -z "$GITLAB_USER_ID" ] || [ "$GITLAB_USER_ID" = "null" ]; then + die "failed to authenticate to gitlab.freedesktop.org with the private token" +fi do_command git push "$ORIGIN" "${BRANCHES[@]}" || die "failed to to push branches ${BRANCHES[@]} to $ORIGIN" @@ -640,4 +642,4 @@ fi if [[ $CREATE_RELEASE_FAIL == 1 ]]; then die "failed creating the release at gitlab.freedesktop.org. This was the last step, create it manually from the web UI" -fi \ No newline at end of file +fi