diff --git a/.ci/containers/downstream-builder/generate_downstream.sh b/.ci/containers/downstream-builder/generate_downstream.sh index 83646af823a0..66c140947561 100755 --- a/.ci/containers/downstream-builder/generate_downstream.sh +++ b/.ci/containers/downstream-builder/generate_downstream.sh @@ -111,11 +111,11 @@ if [ "$REPO" == "terraform" ]; then CHANGELOG=true fi +PR_NUMBER=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \ + "https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls?state=closed&base=master&sort=updated&direction=desc" | \ + jq -r ".[] | if .merge_commit_sha == \"$REFERENCE\" then .number else empty end") if [ "$COMMITTED" == "true" ] && [ "$COMMAND" == "downstream" ] && [ "$CHANGELOG" == "true" ]; then # Add the changelog entry! - PR_NUMBER=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \ - "https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls?state=closed&base=master&sort=updated&direction=desc" | \ - jq -r ".[] | if .merge_commit_sha == \"$REFERENCE\" then .number else empty end") mkdir -p .changelog/ curl -s -H "Authorization: token ${GITHUB_TOKEN}" \ "https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/$PR_NUMBER" | \