Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.

Commit 7064f48

Browse files
authored
Merge pull request #21 from thepwagner/revoke-the-revocable
only save/revoke "revocable" tokens
2 parents 1146b69 + 414987d commit 7064f48

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

dist/index.js

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@ async function run(): Promise<void> {
3232
const res = await http.post(server, tokenReq)
3333

3434
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
3637
if (!token) {
3738
throw new Error('no token')
3839
}
3940
core.setSecret(token)
4041
core.setOutput('token', token)
41-
state.saveToken(token)
42+
if (parsed['revocable']) {
43+
state.saveToken(token)
44+
}
4245
} catch (error) {
4346
if (error instanceof Error) core.setFailed(error.message)
4447
}

0 commit comments

Comments
 (0)