in src/Utils/Actions/RunCsFixerCommand.php [156:173]
private function determineWorkflowFile(string $repo, string $ref): ?array
{
$url = sprintf(
'https://api.github.com/repos/%s/contents/.github/workflows',
$repo
);
$response = $this->client->request('GET', $url);
if ($response->getStatusCode() === 404) {
throw new \Exception('Failed to determine the workflow file, maybe the repo doesn\'t exist?');
}
foreach (json_decode($response->getBody(), true) as $workflow) {
if ($job = $this->getJobFromWorkflowFile($repo, $ref, $workflow['name'])) {
return $job;
}
}
return null;
}