Skip to content

Commit

Permalink
github(artifact): check upload artifact support for GHES
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Jun 24, 2024
1 parent 6f66565 commit 861955a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ 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';
import {GHESNotSupportedError, InvalidResponseError, NetworkError} from '@actions/artifact';
import * as core from '@actions/core';
import {SummaryTableCell} from '@actions/core/lib/summary';
import * as github from '@actions/github';
Expand Down Expand Up @@ -122,6 +123,10 @@ export class GitHub {
}

public static async uploadArtifact(opts: UploadArtifactOpts): Promise<UploadArtifactResponse> {
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();
Expand Down

0 comments on commit 861955a

Please sign in to comment.