scripts: pull_github_pr.sh: Fix auth problem detection
Before the patch, the script printed: parse error: Invalid numeric literal at line 2, column 0 Closes scylladb/scylladb#26818
This commit is contained in:
committed by
Pavel Emelyanov
parent
e7dbccd59e
commit
284c73d466
@@ -133,10 +133,11 @@ check_jenkins_job_status() {
|
||||
|
||||
lastCompletedJobName="$jenkins_url/job/$jenkins_job/lastCompletedBuild"
|
||||
getBuildResult=$(curl -s --user $JENKINS_USERNAME:$JENKINS_API_TOKEN $lastCompletedJobName/api/json?tree=result)
|
||||
if [[ "$getBuildResult" == "*Unauthorized*" ]]; then
|
||||
echo -e "${ORANGE}WARNING:${NC} Failed to authenticate with Jenkins. please check your JENKINS_USERNAME and JENKINS_API_TOKEN setting"
|
||||
if [[ $getBuildResult =~ (Access Denied|401 Unauthorized) ]]; then
|
||||
echo -e "${ORANGE}WARNING:${NC} Access Denied to $lastCompletedJobName. \nPlease check your JENKINS_USERNAME and JENKINS_API_TOKEN setting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
lastCompleted=$(echo "$getBuildResult" | jq -r '.result')
|
||||
|
||||
if [[ "$lastCompleted" == "SUCCESS" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user