Skip to content

Commit c32be97

Browse files
author
Brandon Skinner
authored
Merge pull request #1966 from Automattic/update/changelog_autmation_tweak
Fails circleCI pipeline on failure
2 parents bee907e + 8304924 commit c32be97

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bin/github-changelog.php

+8
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,17 @@ function create_draft_changelog( $title, $content, $tags ) {
7979
curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization:Bearer ' . WP_CHANGELOG_AUTH_TOKEN ] );
8080
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
8181
$response = curl_exec($ch);
82+
$http_code = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
8283
curl_close($ch);
84+
8385
echo "Response:\n";
8486
echo $response;
87+
echo "\nHttpCode: $http_code";
88+
89+
if ( $http_code >= 400 ) {
90+
echo "\n\nFailed to create changelog draft post\n";
91+
exit( 1 );
92+
}
8593
}
8694

8795
function get_changelog_tags( $github_labels ) {

0 commit comments

Comments
 (0)