File tree Expand file tree Collapse file tree 2 files changed +7
-22
lines changed Expand file tree Collapse file tree 2 files changed +7
-22
lines changed Original file line number Diff line number Diff line change 133133 const installationToken = resp.token;
134134 // Need to check accessibility if scope set repository
135135 if (scope !== '' && scope.split('/').length === 2) {
136- const error = yield isExistRepositoryInGitHubApps(
137- installationToken,
138- scope
139- );
140- if (error.error !== '') {
141- throw new Error(error.error);
142- }
136+ yield isExistRepositoryInGitHubApps(installationToken, scope);
143137 }
144138 core.setSecret(installationToken);
145139 core.setOutput('token', installationToken);
162156 (item) => item.full_name === repository
163157 );
164158 if (repo === undefined) {
165- return {
166- error: `GitHub Apps can't accessible repository (${repository})`,
167- } ;
159+ throw new Error(
160+ `GitHub Apps can't accessible repository (${repository})`
161+ ) ;
168162 }
169- return {error: ''};
170163 });
171164 }
172165 run();
Original file line number Diff line number Diff line change @@ -51,13 +51,7 @@ async function run(): Promise<void> {
5151
5252 // Need to check accessibility if scope set repository
5353 if ( scope !== '' && scope . split ( '/' ) . length === 2 ) {
54- const error = await isExistRepositoryInGitHubApps (
55- installationToken ,
56- scope
57- ) ;
58- if ( error . error !== '' ) {
59- throw new Error ( error . error ) ;
60- }
54+ await isExistRepositoryInGitHubApps ( installationToken , scope ) ;
6155 }
6256
6357 core . setSecret ( installationToken ) ;
@@ -72,7 +66,7 @@ async function run(): Promise<void> {
7266async function isExistRepositoryInGitHubApps (
7367 installationToken : string ,
7468 repository : string
75- ) : Promise < { error : string } > {
69+ ) : Promise < void > {
7670 const installationOctokit = new Octokit ( {
7771 auth : installationToken ,
7872 baseUrl : process . env . GITHUB_API_URL || 'https://api.github.com' ,
@@ -84,10 +78,8 @@ async function isExistRepositoryInGitHubApps(
8478 ( item ) => item . full_name === repository
8579 ) ;
8680 if ( repo === undefined ) {
87- return { error : `GitHub Apps can't accessible repository (${ repository } )` } ;
81+ throw new Error ( `GitHub Apps can't accessible repository (${ repository } )` ) ;
8882 }
89-
90- return { error : '' } ;
9183}
9284
9385run ( ) ;
You can’t perform that action at this time.
0 commit comments