1
0
Fork 0

Avoid requiring auth for the funding API access

pull/8453/head
Jordi Boggiano 2020-02-14 11:50:56 +01:00
parent b033a2ae81
commit f171d1fd89
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 12 additions and 7 deletions

View File

@ -194,13 +194,18 @@ class GitHubDriver extends VcsDriver
} }
$graphql = 'query{repository(owner:"'.$this->owner.'",name:"'.$this->repository.'"){fundingLinks{platform,url}}}'; $graphql = 'query{repository(owner:"'.$this->owner.'",name:"'.$this->repository.'"){fundingLinks{platform,url}}}';
$result = $this->remoteFilesystem->getContents($this->originUrl, 'https://api.github.com/graphql', false, [ try {
'http' => [ $result = $this->remoteFilesystem->getContents($this->originUrl, 'https://api.github.com/graphql', false, [
'method' => 'POST', 'http' => [
'content' => json_encode(['query' => $graphql]), 'method' => 'POST',
'header' => ['Content-Type: application/json'], 'content' => json_encode(['query' => $graphql]),
], 'header' => ['Content-Type: application/json'],
]); ],
'retry-auth-failure' => false,
]);
} catch (\TransportException $e) {
return $this->fundingInfo = false;
}
$result = json_decode($result, true); $result = json_decode($result, true);
if (empty($result['data']['repository']['fundingLinks'])) { if (empty($result['data']['repository']['fundingLinks'])) {