10000 Merge pull request #406 from docker/dependabot/npm_and_yarn/actions/a… · docker/actions-toolkit@4db21c4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4db21c4

Browse files
authored
Merge pull request #406 from docker/dependabot/npm_and_yarn/actions/artifact-2.1.8
build(deps): bump @actions/artifact from 2.1.7 to 2.1.8
2 parents 8d807b6 + 99e6b01 commit 4db21c4

File tree

4 files changed

+10
-33
lines changed
8000

4 files changed

+10
-33
lines changed

__tests__/github.test.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -85,28 +85,6 @@ describe('apiURL', () => {
8585
});
8686
});
8787

88-
describe('isGHES', () => {
89-
afterEach(() => {
90-
process.env.GITHUB_SERVER_URL = '';
91-
});
92-
it('should return false when the request domain is github.com', () => {
93-
process.env.GITHUB_SERVER_URL = 'https://github.com';
94-
expect(GitHub.isGHES).toBe(false);
95-
});
96-
it('should return false when the request domain ends with ghe.com', () => {
97-
process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.com';
98-
expect(GitHub.isGHES).toBe(false);
99-
});
100-
it('should return false when the request domain ends with ghe.localhost', () => {
101-
process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.localhost';
102-
expect(GitHub.isGHES).toBe(false);
103-
});
104-
it('should return true when the request domain is specific to an enterprise', () => {
105-
process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com';
106-
expect(GitHub.isGHES).toBe(true);
107-
});
108-
});
109-
11088
describe('repository', () => {
11189
it('returns GitHub repository', async () => {
11290
expect(GitHub.repository).toEqual('docker/actions-toolkit');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"registry": "https://registry.npmjs.org/"
4646
},
4747
"dependencies": {
48-
"@actions/artifact": "^2.1.7",
48+
"@actions/artifact": "^2.1.8",
4949
"@actions/cache": "^3.2.4",
5050
"@actions/core": "^1.10.1",
5151
"@actions/exec": "^1.1.1",

src/github.ts

Lines changed: 4 additions & 5 deletions
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';
@@ -67,11 +68,9 @@ export class GitHub {
6768
}
6869

6970
static get isGHES(): boolean {
70-
const serverURL = new URL(GitHub.serverURL);
71-
const hostname = serverURL.hostname.trimEnd().toUpperCase();
72-
const isGitHubHost = hostname === 'GITHUB.COM';
73-
const isGHESHost = hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST');
74-
return !isGitHubHost && !isGHESHost;
71+
// FIXME: we are using the function from GitHub artifact module but should
72+
// be within core module when available.
73+
return isGhes();
7574
}
7675

7776
static get repository(): string {

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ __metadata:
1212
languageName: node
1313
linkType: hard
1414

15-
"@actions/artifact@npm:^2.1.7":
16-
version: 2.1.7
17-
resolution: "@actions/artifact@npm:2.1.7"
15+
"@actions/artifact@npm:^2.1.8":
16+
version: 2.1.8
17+
resolution: "@actions/artifact@npm:2.1.8"
1818
dependencies:
1919
"@actions/core": ^1.10.0
2020
"@actions/github": ^5.1.1
@@ -30,7 +30,7 @@ __metadata:
3030
jwt-decode: ^3.1.2
3131
twirp-ts: ^2.5.0
3232
unzip-stream: ^0.3.1
33-
checksum: 346c7caf43bdeb4a96c044ca3a6a005d82b977178b1a6be2c6954dfd59fef3344d2576bdd07c6cac9b54207cc88d7b1161cabd08c7cc15a1db86bf82463b36c7
33+
checksum: 51a47c21bcdac705abb61dbaef923f2760354c39bcad44a31b129e18bf31f646e5148f92ee7e1198275d1dba7bebfd1d1500ad7f62f6de1e65b57b2d092d5341
3434
languageName: node
3535
linkType: hard
3636

@@ -1099,7 +1099,7 @@ __metadata:
10991099
version: 0.0.0-use.local
11001100
resolution: "@docker/actions-toolkit@workspace:."
11011101
dependencies:
1102-
"@actions/artifact": ^2.1.7
1102+
"@actions/artifact": ^2.1.8
11031103
"@actions/cache": ^3.2.4
11041104
"@actions/core": ^1.10.1
11051105
"@actions/exec": ^1.1.1

0 commit comments

Comments
 (0)
0