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
This commit is contained in:
CrazyMax 2024-07-15 13:20:46 +02:00 committed by GitHub
commit 4db21c4b43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 33 deletions

View File

@ -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');

View File

@ -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",

View File

@ -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';
@ -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 {

View File

@ -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
@ -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
@ -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