Files
act_runner/internal/act/runner/testdata/actions-environment-and-context-tests/js/index.js
T
Lunny Xiao 825c6af07c refactor: move act under internal
The runner is an application, not a library. `act/model` and
`act/exprparser` were the last packages anything outside this repository
consumed and they now live in actionslib, so nothing needs the rest of
`act` to be importable, and keeping it importable invites the coupling
that was just removed.

Import paths only, the files are unchanged.

Assisted-by: Codet:GPT-5.1-Codex
2026-08-07 21:40:48 -07:00

16 lines
583 B
JavaScript

function checkEnvVar({ name, allowEmpty }) {
if (
process.env[name] === undefined ||
(allowEmpty === false && process.env[name] === "")
) {
throw new Error(
`${name} is undefined` + (allowEmpty === false ? " or empty" : "")
);
}
console.log(`${name}=${process.env[name]}`);
}
checkEnvVar({ name: "GITHUB_ACTION", allowEmpty: false });
checkEnvVar({ name: "GITHUB_ACTION_REPOSITORY", allowEmpty: true /* allows to be empty for local actions */ });
checkEnvVar({ name: "GITHUB_ACTION_REF", allowEmpty: true /* allows to be empty for local actions */ });