diff --git a/hooks/common/pre-flow-feature-finish b/hooks/common/pre-flow-feature-finish index 7f83cbc..cfcedc1 100755 --- a/hooks/common/pre-flow-feature-finish +++ b/hooks/common/pre-flow-feature-finish @@ -72,7 +72,7 @@ elif [[ $ORIGIN_URL =~ ^git@bitbucket\.org ]]; then profile=$(git config bitbucket.cli.profile) verbose "Checking Pull Request on repository $repo for $BRANCH" PR_STATE=$( \ - bb ${profile:+--profile $profile} pr list --repository $repo |\ + bb ${profile:+--profile $profile} pr list --repository $repo --state all --output json |\ jq -r --arg BRANCH $BRANCH ' . |= sort_by(.updated_on) | last(.[] | select(.source.branch.name == $BRANCH) | .state)' @@ -93,7 +93,7 @@ elif [[ $ORIGIN_URL =~ ^https://.*bitbucket\.org ]]; then profile=$(git config bitbucket.cli.profile) verbose "Checking Pull Request on repository $repo for $BRANCH" PR_STATE=$( \ - bb ${profile:+--profile $profile} pr list --repository $repo |\ + bb ${profile:+--profile $profile} pr list --repository $repo --state all --output json |\ jq -r --arg BRANCH $BRANCH ' . |= sort_by(.updated_on) | last(.[] | select(.source.branch.name == $BRANCH) | .state)' diff --git a/hooks/common/pre-flow-hotfix-finish b/hooks/common/pre-flow-hotfix-finish index 99b9b06..df5608c 100755 --- a/hooks/common/pre-flow-hotfix-finish +++ b/hooks/common/pre-flow-hotfix-finish @@ -72,7 +72,7 @@ elif [[ $ORIGIN_URL =~ ^git@bitbucket\.org ]]; then profile=$(git config bitbucket.cli.profile) verbose "Checking Pull Request on repository $repo for $BRANCH" PR_STATE=$( \ - bb ${profile:+--profile $profile} pr list --repository $repo |\ + bb ${profile:+--profile $profile} pr list --repository $repo --state all --output json |\ jq -r --arg BRANCH $BRANCH ' . |= sort_by(.updated_on) | last(.[] | select(.source.branch.name == $BRANCH) | .state)' @@ -93,7 +93,7 @@ elif [[ $ORIGIN_URL =~ ^https://.*bitbucket\.org ]]; then profile=$(git config bitbucket.cli.profile) verbose "Checking Pull Request on repository $repo for $BRANCH" PR_STATE=$( \ - bb ${profile:+--profile $profile} pr list --repository $repo |\ + bb ${profile:+--profile $profile} pr list --repository $repo --state all --output json |\ jq -r --arg BRANCH $BRANCH ' . |= sort_by(.updated_on) | last(.[] | select(.source.branch.name == $BRANCH) | .state)' diff --git a/hooks/common/pre-flow-release-finish b/hooks/common/pre-flow-release-finish index 66e0260..ff05ffa 100755 --- a/hooks/common/pre-flow-release-finish +++ b/hooks/common/pre-flow-release-finish @@ -72,7 +72,7 @@ elif [[ $ORIGIN_URL =~ ^git@bitbucket\.org ]]; then profile=$(git config bitbucket.cli.profile) verbose "Checking Pull Request on repository $repo for $BRANCH" PR_STATE=$( \ - bb ${profile:+--profile $profile} pr list --repository $repo |\ + bb ${profile:+--profile $profile} pr list --repository $repo --state all --output json |\ jq -r --arg BRANCH $BRANCH ' . |= sort_by(.updated_on) | last(.[] | select(.source.branch.name == $BRANCH) | .state)' @@ -93,7 +93,7 @@ elif [[ $ORIGIN_URL =~ ^https://.*bitbucket\.org ]]; then profile=$(git config bitbucket.cli.profile) verbose "Checking Pull Request on repository $repo for $BRANCH" PR_STATE=$( \ - bb ${profile:+--profile $profile} pr list --repository $repo |\ + bb ${profile:+--profile $profile} pr list --repository $repo --state all --output json |\ jq -r --arg BRANCH $BRANCH ' . |= sort_by(.updated_on) | last(.[] | select(.source.branch.name == $BRANCH) | .state)'