actions-toolkit/toolkit/gh-api.php

17 lines
388 B
PHP
Raw Normal View History

2020-10-21 17:38:42 +08:00
<?php
if ( ! function_exists( 'gh_log' ) ) {
require_once __DIR__ . '/php.php';
}
require_once __DIR__ . '/php/vendor/autoload.php';
use Milo\Github\Api;
use Milo\Github\OAuth\Token;
gh_validate_env( 'GITHUB_TOKEN', 'Set the GITHUB_TOKEN env variable' );
$github_api = new Api();
$github_api->setToken( new Token( gh_env( 'GITHUB_TOKEN' ) ) );
2020-11-02 12:31:17 +08:00
$GLOBALS['github_api'] = $github_api;