This repository was archived by the owner on Apr 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -63,13 +63,16 @@ async function run() {
63
63
core.info(`Sending request: ${tokenReq}`);
64
64
const res = await http.post(server, tokenReq);
65
65
const body = await res.readBody();
66
- const token = JSON.parse(body)['token'];
66
+ const parsed = JSON.parse(body);
67
+ const token = parsed['token'];
67
68
if (!token) {
68
69
throw new Error('no token');
69
70
}
70
71
core.setSecret(token);
71
72
core.setOutput('token', token);
72
- state.saveToken(token);
73
+ if (parsed['revocable']) {
74
+ state.saveToken(token);
75
+ }
73
76
}
74
77
catch (error) {
75
78
if (error instanceof Error)
Original file line number Diff line number Diff line change @@ -32,13 +32,16 @@ async function run(): Promise<void> {
32
32
const res = await http . post ( server , tokenReq )
33
33
34
34
const body = await res . readBody ( )
35
- const token = JSON . parse ( body ) [ 'token' ] as string
35
+ const parsed = JSON . parse ( body )
36
+ const token = parsed [ 'token' ] as string
36
37
if ( ! token ) {
37
38
throw new Error ( 'no token' )
38
39
}
39
40
core . setSecret ( token )
40
41
core . setOutput ( 'token' , token )
41
- state . saveToken ( token )
42
+ if ( parsed [ 'revocable' ] ) {
43
+ state . saveToken ( token )
44
+ }
42
45
} catch ( error ) {
43
46
if ( error instanceof Error ) core . setFailed ( error . message )
44
47
}
You can’t perform that action at this time.
0 commit comments