ede6c15881
This adds support for this action to be used in GitHub Enterprise Server. It sends request to the base url extracted from [GITHUB_API_URL](https://docs.github.com/en/enterprise-server@3.10/actions/learn-github-actions/variables#default-environment-variables). --------- Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
23 lines
407 B
JavaScript
23 lines
407 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");
|
|
}
|