Allow testing workflow parsing functionality from PR checks
This commit is contained in:
parent
697ed97fa5
commit
384a214d60
9 changed files with 53 additions and 9 deletions
3
lib/init-action-post-helper.test.js
generated
3
lib/init-action-post-helper.test.js
generated
|
|
@ -38,6 +38,7 @@ const workflow = __importStar(require("./workflow"));
|
|||
(0, testing_utils_1.setupTests)(ava_1.default);
|
||||
(0, ava_1.default)("post: init action with debug mode off", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository";
|
||||
process.env["RUNNER_TEMP"] = tmpDir;
|
||||
const gitHubVersion = {
|
||||
type: util.GitHubVariant.DOTCOM,
|
||||
|
|
@ -59,6 +60,7 @@ const workflow = __importStar(require("./workflow"));
|
|||
});
|
||||
(0, ava_1.default)("post: init action with debug mode on", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository";
|
||||
process.env["RUNNER_TEMP"] = tmpDir;
|
||||
const gitHubVersion = {
|
||||
type: util.GitHubVariant.DOTCOM,
|
||||
|
|
@ -139,6 +141,7 @@ async function testFailedSarifUpload(t, actionsWorkflow, { category } = {}) {
|
|||
};
|
||||
const messages = [];
|
||||
process.env["GITHUB_JOB"] = "analyze";
|
||||
process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository";
|
||||
process.env["GITHUB_WORKSPACE"] =
|
||||
"/home/runner/work/codeql-action/codeql-action";
|
||||
sinon.stub(actionsUtil, "getRequiredInput").withArgs("matrix").returns("{}");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue