@@ -19,7 +19,12 @@ import {
1919 getEnv ,
2020 exportEnvVar ,
2121} from "./environment" ;
22- import { GITHUB_DOTCOM_URL , parseGitHubUrl } from "./github" ;
22+ import {
23+ GITHUB_DOTCOM_URL ,
24+ parseGitHubUrl ,
25+ type GitHubApiCombinedDetails ,
26+ type GitHubApiDetails ,
27+ } from "./github" ;
2328import { Logger } from "./logging" ;
2429import { getRepositoryNwo , RepositoryNwo } from "./repository" ;
2530import {
@@ -31,6 +36,8 @@ import {
3136 parseMatrixInput ,
3237} from "./util" ;
3338
39+ export type { GitHubApiDetails , GitHubApiCombinedDetails } from "./github" ;
40+
3441const GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version" ;
3542
3643/**
@@ -42,39 +49,6 @@ const GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version";
4249 */
4350export const DO_NOT_RETRY_STATUSES = [ 400 , 410 , 422 , 451 ] ;
4451
45- /**
46- * Represents information about a GitHub instance, how to authenticate to it,
47- * and how to authenticate to other repos on it.
48- */
49- export type GitHubApiCombinedDetails = GitHubApiDetails &
50- GitHubApiExternalRepoDetails ;
51-
52- /** Represents information about a GitHub instance. */
53- export type GitHubInstance = {
54- /** The base URL of the GitHub instance, such as `https://github.com`. */
55- url : string ;
56- /**
57- * The API base URL of the GitHub instance, such as `https://api.github.com`.
58- * Typically this is the `api.` subdomain of the `url` domain.
59- */
60- apiURL : string | undefined ;
61- } ;
62-
63- /** Represents a {@link GitHubInstance} with a token for accessing the API. */
64- export type GitHubApiDetails = GitHubInstance & {
65- /** The token to use for accessing the API of the GitHub instance. */
66- auth : string ;
67- } ;
68-
69- /**
70- * Represents information for accessing a repository on the same GitHub instance as the Action
71- * is currently running on.
72- */
73- export type GitHubApiExternalRepoDetails = {
74- /** An optional token for accessing repo(s) on the same GitHub instance. */
75- externalRepoAuth ?: string ;
76- } ;
77-
7852/**
7953 * Gets the configuration for the private registry authentication proxy,
8054 * if it is available in the environment.
0 commit comments