diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index afc7f6a7..366b89f5 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -1,5 +1,9 @@ # @actions/artifact Releases +### 2.1.8 + +- Allows `*.localhost` domains for hostname checks for local development. + ### 2.1.7 - Update unzip-stream dependency and reverted to using `unzip.Extract()` diff --git a/packages/artifact/__tests__/config.test.ts b/packages/artifact/__tests__/config.test.ts index 5afed94d..b9ef643c 100644 --- a/packages/artifact/__tests__/config.test.ts +++ b/packages/artifact/__tests__/config.test.ts @@ -20,6 +20,11 @@ describe('isGhes', () => { expect(config.isGhes()).toBe(false) }) + it('should return false when the request domain ends with .localhost', () => { + process.env.GITHUB_SERVER_URL = 'https://github.localhost' + expect(config.isGhes()).toBe(false) + }) + it('should return false when the request domain is specific to an enterprise', () => { process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com' expect(config.isGhes()).toBe(true) diff --git a/packages/artifact/package.json b/packages/artifact/package.json index ab84d0f2..ba6d873d 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "2.1.7", + "version": "2.1.8", "preview": true, "description": "Actions artifact lib", "keywords": [ diff --git a/packages/artifact/src/internal/shared/config.ts b/packages/artifact/src/internal/shared/config.ts index 089fae14..437a3624 100644 --- a/packages/artifact/src/internal/shared/config.ts +++ b/packages/artifact/src/internal/shared/config.ts @@ -30,10 +30,10 @@ export function isGhes(): boolean { const hostname = ghUrl.hostname.trimEnd().toUpperCase() const isGitHubHost = hostname === 'GITHUB.COM' - const isGheHost = - hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST') + const isGheHost = hostname.endsWith('.GHE.COM') + const isLocalHost = hostname.endsWith('.LOCALHOST') - return !isGitHubHost && !isGheHost + return !isGitHubHost && !isGheHost && !isLocalHost } export function getGitHubWorkspaceDir(): string {