Skip to content

Commit

Permalink
Merge pull request #406 from docker/dependabot/npm_and_yarn/actions/a…
Browse files Browse the repository at this point in the history
…rtifact-2.1.8

build(deps): bump @actions/artifact from 2.1.7 to 2.1.8
  • Loading branch information
crazy-max committed Jul 15, 2024
2 parents 8d807b6 + 99e6b01 commit 4db21c4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 33 deletions.
22 changes: 0 additions & 22 deletions __tests__/github.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,6 @@ describe('apiURL', () => {
});
});

describe('isGHES', () => {
afterEach(() => {
process.env.GITHUB_SERVER_URL = '';
});
it('should return false when the request domain is github.com', () => {
process.env.GITHUB_SERVER_URL = 'https://github.com';
expect(GitHub.isGHES).toBe(false);
});
it('should return false when the request domain ends with ghe.com', () => {
process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.com';
expect(GitHub.isGHES).toBe(false);
});
it('should return false when the request domain ends with ghe.localhost', () => {
process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.localhost';
expect(GitHub.isGHES).toBe(false);
});
it('should return true when the request domain is specific to an enterprise', () => {
process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com';
expect(GitHub.isGHES).toBe(true);
});
});

describe('repository', () => {
it('returns GitHub repository', async () => {
expect(GitHub.repository).toEqual('docker/actions-toolkit');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"registry": "https://registry.npmjs.org/"
},
"dependencies": {
"@actions/artifact": "^2.1.7",
"@actions/artifact": "^2.1.8",
"@actions/cache": "^3.2.4",
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
Expand Down
9 changes: 4 additions & 5 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -67,11 +68,9 @@ export class GitHub {
}

static get isGHES(): boolean {
const serverURL = new URL(GitHub.serverURL);
const hostname = serverURL.hostname.trimEnd().toUpperCase();
const isGitHubHost = hostname === 'github.com';
const isGHESHost = hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST');
return !isGitHubHost && !isGHESHost;
// FIXME: we are using the function from GitHub artifact module but should
// be within core module when available.
return isGhes();
}

static get repository(): string {
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ __metadata:
languageName: node
linkType: hard

"@actions/artifact@npm:^2.1.7":
version: 2.1.7
resolution: "@actions/artifact@npm:2.1.7"
"@actions/artifact@npm:^2.1.8":
version: 2.1.8
resolution: "@actions/artifact@npm:2.1.8"
dependencies:
"@actions/core": ^1.10.0
"@actions/github": ^5.1.1
Expand All @@ -30,7 +30,7 @@ __metadata:
jwt-decode: ^3.1.2
twirp-ts: ^2.5.0
unzip-stream: ^0.3.1
checksum: 346c7caf43bdeb4a96c044ca3a6a005d82b977178b1a6be2c6954dfd59fef3344d2576bdd07c6cac9b54207cc88d7b1161cabd08c7cc15a1db86bf82463b36c7
checksum: 51a47c21bcdac705abb61dbaef923f2760354c39bcad44a31b129e18bf31f646e5148f92ee7e1198275d1dba7bebfd1d1500ad7f62f6de1e65b57b2d092d5341
languageName: node
linkType: hard

Expand Down Expand Up @@ -1099,7 +1099,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@docker/actions-toolkit@workspace:."
dependencies:
"@actions/artifact": ^2.1.7
"@actions/artifact": ^2.1.8
"@actions/cache": ^3.2.4
"@actions/core": ^1.10.1
"@actions/exec": ^1.1.1
Expand Down

0 comments on commit 4db21c4

Please sign in to comment.