From 6f45e3c98994e40a55a3e8aecd2c3770d494e72a Mon Sep 17 00:00:00 2001 From: "Gudmundur D. Haraldsson" Date: Tue, 19 Sep 2023 17:04:07 +0000 Subject: [PATCH 1/2] Adding GitHub API header --- latest-release.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/latest-release.php b/latest-release.php index a37c0ddc8..2b66a953d 100755 --- a/latest-release.php +++ b/latest-release.php @@ -10,8 +10,9 @@ declare(strict_types=1); -$github_url = 'https://api.github.com/repos/automattic/vip-go-ci/releases'; -$client_id = 'automattic-vip-go-ci-release-checker'; +$github_url = 'https://api.github.com/repos/automattic/vip-go-ci/releases'; +$client_id = 'automattic-vip-go-ci-release-checker'; +$github_api_version = 'X-GitHub-Api-Version: 2022-11-28'; // If updated, update defines.php too. $ch = curl_init(); @@ -21,7 +22,7 @@ curl_setopt( $ch, CURLOPT_USERAGENT, $client_id ); curl_setopt( $ch, CURLOPT_MAXREDIRS, 0 ); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, false ); - +curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $github_api_version ) ); $resp_data_raw = curl_exec( $ch ); From b187ff69a6cec61dd2283b6203edd85fbd747347 Mon Sep 17 00:00:00 2001 From: "Gudmundur D. Haraldsson" Date: Tue, 19 Sep 2023 17:04:17 +0000 Subject: [PATCH 2/2] Adding comment --- defines.php | 1 + 1 file changed, 1 insertion(+) diff --git a/defines.php b/defines.php index 2778ff8ee..dcd32ca4c 100644 --- a/defines.php +++ b/defines.php @@ -35,6 +35,7 @@ define( 'VIPGOCI_GITHUB_BASE_URL', 'https://api.github.com' ); } +// GitHub API version header. If updated, update latest-release.php too. define( 'VIPGOCI_GITHUB_API_VERSION', '2022-11-28' ); /*