2540ed49e5
Check before trying to revoke the token, in case the token generation failed. Otherwise the post step will throw an error. --------- Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
23 lines
409 B
JavaScript
23 lines
409 B
JavaScript
// @ts-check
|
|
|
|
import core from "@actions/core";
|
|
import { request } from "@octokit/request";
|
|
|
|
/**
|
|
* @param {core} core
|
|
* @param {request} request
|
|
*/
|
|
export async function post(core, request) {
|
|
const token = core.getState("token");
|
|
|
|
if (!token) return;
|
|
|
|
await request("DELETE /installation/token", {
|
|
headers: {
|
|
authorization: `token ${token}`,
|
|
},
|
|
});
|
|
|
|
core.info("Token revoked");
|
|
}
|