Upload with artifacts-legacy when running GHES, else with artifacts

`@actions/artifacts@v1` is still not yet supported on GHES and we need to maintain backwards compatibility here. If we detect that a user is running on GHES, we fall back on the original `v1` import.
This commit is contained in:
Angela P Wen
2024-09-04 14:07:49 -07:00
parent cdcb85f97a
commit d5ac485319
12 changed files with 133 additions and 38 deletions

View File

@@ -28,6 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
const ava_1 = __importDefault(require("ava"));
const debugArtifacts = __importStar(require("./debug-artifacts"));
const util_1 = require("./util");
(0, ava_1.default)("sanitizeArifactName", (t) => {
t.deepEqual(debugArtifacts.sanitizeArifactName("hello-world_"), "hello-world_");
t.deepEqual(debugArtifacts.sanitizeArifactName("hello`world`"), "helloworld");
@@ -36,6 +37,6 @@ const debugArtifacts = __importStar(require("./debug-artifacts"));
});
(0, ava_1.default)("uploadDebugArtifacts", async (t) => {
// Test that no error is thrown if artifacts list is empty.
await t.notThrowsAsync(debugArtifacts.uploadDebugArtifacts([], "rootDir", "artifactName"));
await t.notThrowsAsync(debugArtifacts.uploadDebugArtifacts([], "rootDir", "artifactName", util_1.GitHubVariant.DOTCOM));
});
//# sourceMappingURL=debug-artifacts.test.js.map