mirror of
https://github.com/actions/create-github-app-token.git
synced 2026-12-03 15:09:03 +00:00
23 lines
720 B
JavaScript
23 lines
720 B
JavaScript
import { DEFAULT_ENV } from "./main.js";
|
|
|
|
for (const [key, value] of Object.entries({
|
|
...DEFAULT_ENV,
|
|
"INPUT_PRIVATE-KEY": "",
|
|
})) {
|
|
process.env[key] = value;
|
|
}
|
|
|
|
// Log only the error message, not the full stack trace, because the stack
|
|
// trace contains environment-specific paths and ANSI codes that differ
|
|
// between local and CI environments.
|
|
const _error = console.error;
|
|
console.error = (err) => _error(err?.message ?? err);
|
|
|
|
delete process.env.ACTIONS_ID_TOKEN_REQUEST_URL;
|
|
delete process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;
|
|
|
|
// Verify a missing private-key without OIDC permissions produces an actionable error.
|
|
const { default: promise } = await import("../main.js");
|
|
await promise;
|
|
process.exitCode = 0;
|