Skip to content

Commit bbf0a8d

Browse files
authored
Merge pull request #382 from crazy-max/github-upload-artifact-ghes
github(artifact): check upload artifact support for GHES
2 parents 6f66565 + 4ce8a70 commit bbf0a8d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/github.ts

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import os from 'os';
2222
import path from 'path';
2323
import {CreateArtifactRequest, FinalizeArtifactRequest, StringValue} from '@actions/artifact/lib/generated';
2424
import {internalArtifactTwirpClient} from '@actions/artifact/lib/internal/shared/artifact-twirp-client';
25+
import {isGhes} from '@actions/artifact/lib/internal/shared/config';
2526
import {getBackendIdsFromToken} from '@actions/artifact/lib/internal/shared/util';
2627
import {getExpiration} from '@actions/artifact/lib/internal/upload/retention';
2728
import {InvalidResponseError, NetworkError} from '@actions/artifact';
@@ -122,6 +123,10 @@ export class GitHub {
122123
}
123124

124125
public static async uploadArtifact(opts: UploadArtifactOpts): Promise<UploadArtifactResponse> {
126+
if (isGhes()) {
127+
throw new Error('@actions/artifact v2.0.0+ is currently not supported on GHES.');
128+
}
129+
125130
const artifactName = path.basename(opts.filename);
126131
const backendIds = getBackendIdsFromToken();
127132
const artifactClient = internalArtifactTwirpClient();

0 commit comments

Comments
 (0)