Avoid requiring auth for the funding API access
parent
b033a2ae81
commit
f171d1fd89
|
@ -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}}}';
|
||||||
|
try {
|
||||||
$result = $this->remoteFilesystem->getContents($this->originUrl, 'https://api.github.com/graphql', false, [
|
$result = $this->remoteFilesystem->getContents($this->originUrl, 'https://api.github.com/graphql', false, [
|
||||||
'http' => [
|
'http' => [
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
'content' => json_encode(['query' => $graphql]),
|
'content' => json_encode(['query' => $graphql]),
|
||||||
'header' => ['Content-Type: application/json'],
|
'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'])) {
|
||||||
|
|
Loading…
Reference in New Issue