From bfde620968f305a9d9f0d1771cca4759ad934363 Mon Sep 17 00:00:00 2001 From: Gildas Cherruel Date: Wed, 15 Nov 2023 16:05:49 +0900 Subject: [PATCH] Wrong variable --- hooks/common/pre-flow-feature-finish | 4 ++-- hooks/common/pre-flow-hotfix-finish | 4 ++-- hooks/common/pre-flow-release-finish | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hooks/common/pre-flow-feature-finish b/hooks/common/pre-flow-feature-finish index 3466499..272a028 100755 --- a/hooks/common/pre-flow-feature-finish +++ b/hooks/common/pre-flow-feature-finish @@ -73,7 +73,7 @@ elif [[ $ORIGIN_URL =~ ^git@bitbucket\.org ]]; then [[ -z $token ]] && die "Bitbucket's API Access Token is empty" verbose "Checking Pull Request on repository $repo for $BRANCH" PR_STATE=$(curl -sS \ - --header "Authorization: Bearer $(git config bitbucket.api.username)" \ + --header "Authorization: Bearer $token" \ https://api.bitbucket.org/2.0/repositories/${repo}/pullrequests?state=ALL |\ jq -r --arg BRANCH $BRANCH ' .values |= sort_by(.updated_on) | @@ -96,7 +96,7 @@ elif [[ $ORIGIN_URL =~ ^https://.*bitbucket\.org ]]; then [[ -z $token ]] && die "Bitbucket's API Access Token is empty" verbose "Checking Pull Request on repository $repo for $BRANCH" PR_STATE=$(curl -sS \ - --header "Authorization: Bearer $(git config bitbucket.api.username)" \ + --header "Authorization: Bearer $token" \ https://api.bitbucket.org/2.0/repositories/${repo}/pullrequests?state=ALL |\ jq -r --arg BRANCH $BRANCH ' .values |= sort_by(.updated_on) | diff --git a/hooks/common/pre-flow-hotfix-finish b/hooks/common/pre-flow-hotfix-finish index 39058bd..afe7654 100755 --- a/hooks/common/pre-flow-hotfix-finish +++ b/hooks/common/pre-flow-hotfix-finish @@ -73,7 +73,7 @@ elif [[ $ORIGIN_URL =~ ^git@bitbucket\.org ]]; then [[ -z $token ]] && die "Bitbucket's API Access Token is empty" verbose "Checking Pull Request on repository $repo for $BRANCH" PR_STATE=$(curl -sS \ - --header "Authorization: Bearer $(git config bitbucket.api.username)" \ + --header "Authorization: Bearer $token" \ https://api.bitbucket.org/2.0/repositories/${repo}/pullrequests?state=ALL |\ jq -r --arg BRANCH $BRANCH ' .values |= sort_by(.updated_on) | @@ -96,7 +96,7 @@ elif [[ $ORIGIN_URL =~ ^https://.*bitbucket\.org ]]; then [[ -z $token ]] && die "Bitbucket's API Access Token is empty" verbose "Checking Pull Request on repository $repo for $BRANCH" PR_STATE=$(curl -sS \ - --header "Authorization: Bearer $(git config bitbucket.api.username)" \ + --header "Authorization: Bearer $token" \ https://api.bitbucket.org/2.0/repositories/${repo}/pullrequests?state=ALL |\ jq -r --arg BRANCH $BRANCH ' .values |= sort_by(.updated_on) | diff --git a/hooks/common/pre-flow-release-finish b/hooks/common/pre-flow-release-finish index 3877785..26fe184 100755 --- a/hooks/common/pre-flow-release-finish +++ b/hooks/common/pre-flow-release-finish @@ -73,7 +73,7 @@ elif [[ $ORIGIN_URL =~ ^git@bitbucket\.org ]]; then [[ -z $token ]] && die "Bitbucket's API Access Token is empty" verbose "Checking Pull Request on repository $repo for $BRANCH" PR_STATE=$(curl -sS \ - --header "Authorization: Bearer $(git config bitbucket.api.username)" \ + --header "Authorization: Bearer $token" \ https://api.bitbucket.org/2.0/repositories/${repo}/pullrequests?state=ALL |\ jq -r --arg BRANCH $BRANCH ' .values |= sort_by(.updated_on) | @@ -96,7 +96,7 @@ elif [[ $ORIGIN_URL =~ ^https://.*bitbucket\.org ]]; then [[ -z $token ]] && die "Bitbucket's API Access Token is empty" verbose "Checking Pull Request on repository $repo for $BRANCH" PR_STATE=$(curl -sS \ - --header "Authorization: Bearer $(git config bitbucket.api.username)" \ + --header "Authorization: Bearer $token" \ https://api.bitbucket.org/2.0/repositories/${repo}/pullrequests?state=ALL |\ jq -r --arg BRANCH $BRANCH ' .values |= sort_by(.updated_on) |