From 4ce8a708c9dfec6500ac3ad14549bd62a2a12cd5 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:25:51 +0200 Subject: [PATCH] github(artifact): check upload artifact support for GHES Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- src/github.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/github.ts b/src/github.ts index a66c328..9cfeb01 100644 --- a/src/github.ts +++ b/src/github.ts @@ -22,6 +22,7 @@ import os from 'os'; import path from 'path'; import {CreateArtifactRequest, FinalizeArtifactRequest, StringValue} from '@actions/artifact/lib/generated'; import {internalArtifactTwirpClient} from '@actions/artifact/lib/internal/shared/artifact-twirp-client'; +import {isGhes} from '@actions/artifact/lib/internal/shared/config'; import {getBackendIdsFromToken} from '@actions/artifact/lib/internal/shared/util'; import {getExpiration} from '@actions/artifact/lib/internal/upload/retention'; import {InvalidResponseError, NetworkError} from '@actions/artifact'; @@ -122,6 +123,10 @@ export class GitHub { } public static async uploadArtifact(opts: UploadArtifactOpts): Promise { + if (isGhes()) { + throw new Error('@actions/artifact v2.0.0+ is currently not supported on GHES.'); + } + const artifactName = path.basename(opts.filename); const backendIds = getBackendIdsFromToken(); const artifactClient = internalArtifactTwirpClient();