Skip to content

Commit

Permalink
Fetch PR number even if we writing a changelog, needed for message (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
slevenick authored Feb 20, 2020
1 parent 547fc6f commit da6931d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .ci/containers/downstream-builder/generate_downstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" | \
Expand Down

0 comments on commit da6931d

Please sign in to comment.