3
0
Fork 0
mirror of https://gitea.com/docker/login-action.git synced 2024-11-23 01:49:36 +01:00

Merge pull request #754 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.35.0

build(deps): bump @docker/actions-toolkit from 0.24.0 to 0.35.0
This commit is contained in:
CrazyMax 2024-07-22 10:45:24 +02:00 committed by GitHub
commit e0394952ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 2840 additions and 33 deletions

View file

@ -2,14 +2,15 @@ import {expect, jest, test} from '@jest/globals';
import * as path from 'path'; import * as path from 'path';
import {loginStandard, logout} from '../src/docker'; import {loginStandard, logout} from '../src/docker';
import {Exec} from '@docker/actions-toolkit/lib/exec';
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
process.env['RUNNER_TEMP'] = path.join(__dirname, 'runner'); process.env['RUNNER_TEMP'] = path.join(__dirname, 'runner');
test('loginStandard calls exec', async () => { test('loginStandard calls exec', async () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
const execSpy = jest.spyOn(Exec, 'getExecOutput').mockImplementation(async () => { const execSpy = jest.spyOn(Docker, 'getExecOutput').mockImplementation(async () => {
return { return {
exitCode: expect.any(Number), exitCode: expect.any(Number),
stdout: expect.any(Function), stdout: expect.any(Function),
@ -23,7 +24,13 @@ test('loginStandard calls exec', async () => {
await loginStandard(registry, username, password); await loginStandard(registry, username, password);
expect(execSpy).toHaveBeenCalledWith(`docker`, ['login', '--password-stdin', '--username', username, registry], { expect(execSpy).toHaveBeenCalledTimes(1);
const callfunc = execSpy.mock.calls[0];
if (callfunc && callfunc[1]) {
// we don't want to check env opt
callfunc[1].env = undefined;
}
expect(execSpy).toHaveBeenCalledWith(['login', '--password-stdin', '--username', username, registry], {
input: Buffer.from(password), input: Buffer.from(password),
silent: true, silent: true,
ignoreReturnCode: true ignoreReturnCode: true
@ -33,7 +40,7 @@ test('loginStandard calls exec', async () => {
test('logout calls exec', async () => { test('logout calls exec', async () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
const execSpy = jest.spyOn(Exec, 'getExecOutput').mockImplementation(async () => { const execSpy = jest.spyOn(Docker, 'getExecOutput').mockImplementation(async () => {
return { return {
exitCode: expect.any(Number), exitCode: expect.any(Number),
stdout: expect.any(Function), stdout: expect.any(Function),
@ -45,7 +52,13 @@ test('logout calls exec', async () => {
await logout(registry); await logout(registry);
expect(execSpy).toHaveBeenCalledWith(`docker`, ['logout', registry], { expect(execSpy).toHaveBeenCalledTimes(1);
const callfunc = execSpy.mock.calls[0];
if (callfunc && callfunc[1]) {
// we don't want to check env opt
callfunc[1].env = undefined;
}
expect(execSpy).toHaveBeenCalledWith(['logout', registry], {
ignoreReturnCode: true ignoreReturnCode: true
}); });
}); });

97
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

2564
dist/licenses.txt generated vendored

File diff suppressed because it is too large Load diff

View file

@ -28,7 +28,7 @@
"@actions/core": "^1.10.1", "@actions/core": "^1.10.1",
"@aws-sdk/client-ecr": "^3.583.0", "@aws-sdk/client-ecr": "^3.583.0",
"@aws-sdk/client-ecr-public": "^3.583.0", "@aws-sdk/client-ecr-public": "^3.583.0",
"@docker/actions-toolkit": "^0.24.0", "@docker/actions-toolkit": "^0.35.0",
"http-proxy-agent": "^7.0.2", "http-proxy-agent": "^7.0.2",
"https-proxy-agent": "^7.0.4" "https-proxy-agent": "^7.0.4"
}, },

View file

@ -1,6 +1,7 @@
import * as aws from './aws'; import * as aws from './aws';
import * as core from '@actions/core'; import * as core from '@actions/core';
import {Exec} from '@docker/actions-toolkit/lib/exec';
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
export async function login(registry: string, username: string, password: string, ecr: string): Promise<void> { export async function login(registry: string, username: string, password: string, ecr: string): Promise<void> {
if (/true/i.test(ecr) || (ecr == 'auto' && aws.isECR(registry))) { if (/true/i.test(ecr) || (ecr == 'auto' && aws.isECR(registry))) {
@ -11,7 +12,7 @@ export async function login(registry: string, username: string, password: string
} }
export async function logout(registry: string): Promise<void> { export async function logout(registry: string): Promise<void> {
await Exec.getExecOutput('docker', ['logout', registry], { await Docker.getExecOutput(['logout', registry], {
ignoreReturnCode: true ignoreReturnCode: true
}).then(res => { }).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) { if (res.stderr.length > 0 && res.exitCode != 0) {
@ -40,7 +41,7 @@ export async function loginStandard(registry: string, username: string, password
} else { } else {
core.info(`Logging into Docker Hub...`); core.info(`Logging into Docker Hub...`);
} }
await Exec.getExecOutput('docker', loginArgs, { await Docker.getExecOutput(loginArgs, {
ignoreReturnCode: true, ignoreReturnCode: true,
silent: true, silent: true,
input: Buffer.from(password) input: Buffer.from(password)
@ -57,7 +58,7 @@ export async function loginECR(registry: string, username: string, password: str
const regDatas = await aws.getRegistriesData(registry, username, password); const regDatas = await aws.getRegistriesData(registry, username, password);
for (const regData of regDatas) { for (const regData of regDatas) {
core.info(`Logging into ${regData.registry}...`); core.info(`Logging into ${regData.registry}...`);
await Exec.getExecOutput('docker', ['login', '--password-stdin', '--username', regData.username, regData.registry], { await Docker.getExecOutput(['login', '--password-stdin', '--username', regData.username, regData.registry], {
ignoreReturnCode: true, ignoreReturnCode: true,
silent: true, silent: true,
input: Buffer.from(regData.password) input: Buffer.from(regData.password)

176
yarn.lock
View file

@ -12,9 +12,9 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@actions/artifact@npm:^2.1.7": "@actions/artifact@npm:^2.1.8":
version: 2.1.7 version: 2.1.8
resolution: "@actions/artifact@npm:2.1.7" resolution: "@actions/artifact@npm:2.1.8"
dependencies: dependencies:
"@actions/core": ^1.10.0 "@actions/core": ^1.10.0
"@actions/github": ^5.1.1 "@actions/github": ^5.1.1
@ -30,7 +30,7 @@ __metadata:
jwt-decode: ^3.1.2 jwt-decode: ^3.1.2
twirp-ts: ^2.5.0 twirp-ts: ^2.5.0
unzip-stream: ^0.3.1 unzip-stream: ^0.3.1
checksum: 346c7caf43bdeb4a96c044ca3a6a005d82b977178b1a6be2c6954dfd59fef3344d2576bdd07c6cac9b54207cc88d7b1161cabd08c7cc15a1db86bf82463b36c7 checksum: 51a47c21bcdac705abb61dbaef923f2760354c39bcad44a31b129e18bf31f646e5148f92ee7e1198275d1dba7bebfd1d1500ad7f62f6de1e65b57b2d092d5341
languageName: node languageName: node
linkType: hard linkType: hard
@ -1659,11 +1659,11 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@docker/actions-toolkit@npm:^0.24.0": "@docker/actions-toolkit@npm:^0.35.0":
version: 0.24.0 version: 0.35.0
resolution: "@docker/actions-toolkit@npm:0.24.0" resolution: "@docker/actions-toolkit@npm:0.35.0"
dependencies: dependencies:
"@actions/artifact": ^2.1.7 "@actions/artifact": ^2.1.8
"@actions/cache": ^3.2.4 "@actions/cache": ^3.2.4
"@actions/core": ^1.10.1 "@actions/core": ^1.10.1
"@actions/exec": ^1.1.1 "@actions/exec": ^1.1.1
@ -1676,12 +1676,15 @@ __metadata:
"@octokit/plugin-rest-endpoint-methods": ^10.4.0 "@octokit/plugin-rest-endpoint-methods": ^10.4.0
async-retry: ^1.3.3 async-retry: ^1.3.3
csv-parse: ^5.5.6 csv-parse: ^5.5.6
gunzip-maybe: ^1.4.2
handlebars: ^4.7.8 handlebars: ^4.7.8
he: ^1.2.0
js-yaml: ^4.1.0 js-yaml: ^4.1.0
jwt-decode: ^4.0.0 jwt-decode: ^4.0.0
semver: ^7.6.2 semver: ^7.6.3
tar-stream: ^3.1.7
tmp: ^0.2.3 tmp: ^0.2.3
checksum: f9610ca263ba98bdf52736727b375930e2d20402e810c3d1d69b74fbe0a1c689ce4f04a1d02e058e9958a059c3bf01358d4428363bd02c702c05fda9e3fd82af checksum: 27fa4a500e94beff376bc322cc1074c82b20f6ceb0104c43ed5efc613763c8b7ea37b231c32c4dfcb5f7ce8a14948eecc799aa363d60d11d848466d5718d63f0
languageName: node languageName: node
linkType: hard linkType: hard
@ -3720,6 +3723,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"browserify-zlib@npm:^0.1.4":
version: 0.1.4
resolution: "browserify-zlib@npm:0.1.4"
dependencies:
pako: ~0.2.0
checksum: abee4cb4349e8a21391fd874564f41b113fe691372913980e6fa06a777e4ea2aad4e942af14ab99bce190d5ac8f5328201432f4ef0eae48c6d02208bc212976f
languageName: node
linkType: hard
"browserslist@npm:^4.17.5": "browserslist@npm:^4.17.5":
version: 4.19.3 version: 4.19.3
resolution: "browserslist@npm:4.19.3" resolution: "browserslist@npm:4.19.3"
@ -4201,7 +4213,7 @@ __metadata:
"@actions/core": ^1.10.1 "@actions/core": ^1.10.1
"@aws-sdk/client-ecr": ^3.583.0 "@aws-sdk/client-ecr": ^3.583.0
"@aws-sdk/client-ecr-public": ^3.583.0 "@aws-sdk/client-ecr-public": ^3.583.0
"@docker/actions-toolkit": ^0.24.0 "@docker/actions-toolkit": ^0.35.0
"@types/node": ^20.12.12 "@types/node": ^20.12.12
"@typescript-eslint/eslint-plugin": ^7.9.0 "@typescript-eslint/eslint-plugin": ^7.9.0
"@typescript-eslint/parser": ^7.9.0 "@typescript-eslint/parser": ^7.9.0
@ -4241,6 +4253,18 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"duplexify@npm:^3.5.0, duplexify@npm:^3.6.0":
version: 3.7.1
resolution: "duplexify@npm:3.7.1"
dependencies:
end-of-stream: ^1.0.0
inherits: ^2.0.1
readable-stream: ^2.0.0
stream-shift: ^1.0.0
checksum: 3c2ed2223d956a5da713dae12ba8295acb61d9acd966ccbba938090d04f4574ca4dca75cca089b5077c2d7e66101f32e6ea9b36a78ca213eff574e7a8b8accf2
languageName: node
linkType: hard
"eastasianwidth@npm:^0.2.0": "eastasianwidth@npm:^0.2.0":
version: 0.2.0 version: 0.2.0
resolution: "eastasianwidth@npm:0.2.0" resolution: "eastasianwidth@npm:0.2.0"
@ -4292,6 +4316,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"end-of-stream@npm:^1.0.0, end-of-stream@npm:^1.1.0":
version: 1.4.4
resolution: "end-of-stream@npm:1.4.4"
dependencies:
once: ^1.4.0
checksum: 530a5a5a1e517e962854a31693dbb5c0b2fc40b46dad2a56a2deec656ca040631124f4795823acc68238147805f8b021abbe221f4afed5ef3c8e8efc2024908b
languageName: node
linkType: hard
"env-paths@npm:^2.2.0": "env-paths@npm:^2.2.0":
version: 2.2.1 version: 2.2.1
resolution: "env-paths@npm:2.2.1" resolution: "env-paths@npm:2.2.1"
@ -4963,6 +4996,22 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"gunzip-maybe@npm:^1.4.2":
version: 1.4.2
resolution: "gunzip-maybe@npm:1.4.2"
dependencies:
browserify-zlib: ^0.1.4
is-deflate: ^1.0.0
is-gzip: ^1.0.0
peek-stream: ^1.1.0
pumpify: ^1.3.3
through2: ^2.0.3
bin:
gunzip-maybe: bin.js
checksum: bc4d4977c24a2860238df271de75d53dd72a359d19f1248d1c613807dc221d3b8ae09624e3085c8106663e3e1b59db62a85b261d1138c2cc24efad9df577d4e1
languageName: node
linkType: hard
"handlebars@npm:^4.7.8": "handlebars@npm:^4.7.8":
version: 4.7.8 version: 4.7.8
resolution: "handlebars@npm:4.7.8" resolution: "handlebars@npm:4.7.8"
@ -5004,6 +5053,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"he@npm:^1.2.0":
version: 1.2.0
resolution: "he@npm:1.2.0"
bin:
he: bin/he
checksum: 3d4d6babccccd79c5c5a3f929a68af33360d6445587d628087f39a965079d84f18ce9c3d3f917ee1e3978916fc833bb8b29377c3b403f919426f91bc6965e7a7
languageName: node
linkType: hard
"html-escaper@npm:^2.0.0": "html-escaper@npm:^2.0.0":
version: 2.0.2 version: 2.0.2
resolution: "html-escaper@npm:2.0.2" resolution: "html-escaper@npm:2.0.2"
@ -5121,7 +5179,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"inherits@npm:2, inherits@npm:~2.0.3": "inherits@npm:2, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:~2.0.3":
version: 2.0.4 version: 2.0.4
resolution: "inherits@npm:2.0.4" resolution: "inherits@npm:2.0.4"
checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1
@ -5154,6 +5212,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"is-deflate@npm:^1.0.0":
version: 1.0.0
resolution: "is-deflate@npm:1.0.0"
checksum: c2f9f2d3db79ac50c5586697d1e69a55282a2b0cc5e437b3c470dd47f24e40b6216dcd7e024511e21381607bf57afa019343e3bd0e08a119032818b596004262
languageName: node
linkType: hard
"is-extglob@npm:^2.1.1": "is-extglob@npm:^2.1.1":
version: 2.1.1 version: 2.1.1
resolution: "is-extglob@npm:2.1.1" resolution: "is-extglob@npm:2.1.1"
@ -5184,6 +5249,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"is-gzip@npm:^1.0.0":
version: 1.0.0
resolution: "is-gzip@npm:1.0.0"
checksum: 0d28931c1f445fa29c900cf9f48e06e9d1d477a3bf7bd7332e7ce68f1333ccd8cb381de2f0f62a9a262d9c0912608a9a71b4a40e788e201b3dbd67072bb20d86
languageName: node
linkType: hard
"is-lambda@npm:^1.0.1": "is-lambda@npm:^1.0.1":
version: 1.0.1 version: 1.0.1
resolution: "is-lambda@npm:1.0.1" resolution: "is-lambda@npm:1.0.1"
@ -6338,7 +6410,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"once@npm:^1.3.0, once@npm:^1.4.0": "once@npm:^1.3.0, once@npm:^1.3.1, once@npm:^1.4.0":
version: 1.4.0 version: 1.4.0
resolution: "once@npm:1.4.0" resolution: "once@npm:1.4.0"
dependencies: dependencies:
@ -6422,6 +6494,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"pako@npm:~0.2.0":
version: 0.2.9
resolution: "pako@npm:0.2.9"
checksum: 055f9487cd57fbb78df84315873bbdd089ba286f3499daed47d2effdc6253e981f5db6898c23486de76d4a781559f890d643bd3a49f70f1b4a18019c98aa5125
languageName: node
linkType: hard
"parent-module@npm:^1.0.0": "parent-module@npm:^1.0.0":
version: 1.0.1 version: 1.0.1
resolution: "parent-module@npm:1.0.1" resolution: "parent-module@npm:1.0.1"
@ -6515,6 +6594,17 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"peek-stream@npm:^1.1.0":
version: 1.1.3
resolution: "peek-stream@npm:1.1.3"
dependencies:
buffer-from: ^1.0.0
duplexify: ^3.5.0
through2: ^2.0.3
checksum: a0e09d6d1a8a01158a3334f20d6b1cdd91747eba24eb06a1d742eefb620385593121a76d4378cc81f77cdce6a66df0575a41041b1189c510254aec91878afc99
languageName: node
linkType: hard
"picocolors@npm:^1.0.0": "picocolors@npm:^1.0.0":
version: 1.0.0 version: 1.0.0
resolution: "picocolors@npm:1.0.0" resolution: "picocolors@npm:1.0.0"
@ -6638,6 +6728,27 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"pump@npm:^2.0.0":
version: 2.0.1
resolution: "pump@npm:2.0.1"
dependencies:
end-of-stream: ^1.1.0
once: ^1.3.1
checksum: e9f26a17be00810bff37ad0171edb35f58b242487b0444f92fb7d78bc7d61442fa9b9c5bd93a43fd8fd8ddd3cc75f1221f5e04c790f42907e5baab7cf5e2b931
languageName: node
linkType: hard
"pumpify@npm:^1.3.3":
version: 1.5.1
resolution: "pumpify@npm:1.5.1"
dependencies:
duplexify: ^3.6.0
inherits: ^2.0.3
pump: ^2.0.0
checksum: 26ca412ec8d665bd0d5e185c1b8f627728eff603440d75d22a58e421e3c66eaf86ec6fc6a6efc54808ecef65979279fa8e99b109a23ec1fa8d79f37e6978c9bd
languageName: node
linkType: hard
"punycode@npm:^2.1.0": "punycode@npm:^2.1.0":
version: 2.1.1 version: 2.1.1
resolution: "punycode@npm:2.1.1" resolution: "punycode@npm:2.1.1"
@ -6673,7 +6784,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"readable-stream@npm:^2.0.5": "readable-stream@npm:^2.0.0, readable-stream@npm:^2.0.5, readable-stream@npm:~2.3.6":
version: 2.3.8 version: 2.3.8
resolution: "readable-stream@npm:2.3.8" resolution: "readable-stream@npm:2.3.8"
dependencies: dependencies:
@ -6862,7 +6973,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"semver@npm:^7.6.0, semver@npm:^7.6.2": "semver@npm:^7.6.0":
version: 7.6.2 version: 7.6.2
resolution: "semver@npm:7.6.2" resolution: "semver@npm:7.6.2"
bin: bin:
@ -6871,6 +6982,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"semver@npm:^7.6.3":
version: 7.6.3
resolution: "semver@npm:7.6.3"
bin:
semver: bin/semver.js
checksum: 4110ec5d015c9438f322257b1c51fe30276e5f766a3f64c09edd1d7ea7118ecbc3f379f3b69032bacf13116dc7abc4ad8ce0d7e2bd642e26b0d271b56b61a7d8
languageName: node
linkType: hard
"shebang-command@npm:^2.0.0": "shebang-command@npm:^2.0.0":
version: 2.0.0 version: 2.0.0
resolution: "shebang-command@npm:2.0.0" resolution: "shebang-command@npm:2.0.0"
@ -6999,6 +7119,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"stream-shift@npm:^1.0.0":
version: 1.0.3
resolution: "stream-shift@npm:1.0.3"
checksum: a24c0a3f66a8f9024bd1d579a533a53be283b4475d4e6b4b3211b964031447bdf6532dd1f3c2b0ad66752554391b7c62bd7ca4559193381f766534e723d50242
languageName: node
linkType: hard
"streamx@npm:^2.15.0": "streamx@npm:^2.15.0":
version: 2.16.1 version: 2.16.1
resolution: "streamx@npm:2.16.1" resolution: "streamx@npm:2.16.1"
@ -7173,7 +7300,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"tar-stream@npm:^3.0.0": "tar-stream@npm:^3.0.0, tar-stream@npm:^3.1.7":
version: 3.1.7 version: 3.1.7
resolution: "tar-stream@npm:3.1.7" resolution: "tar-stream@npm:3.1.7"
dependencies: dependencies:
@ -7216,6 +7343,16 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"through2@npm:^2.0.3":
version: 2.0.5
resolution: "through2@npm:2.0.5"
dependencies:
readable-stream: ~2.3.6
xtend: ~4.0.1
checksum: beb0f338aa2931e5660ec7bf3ad949e6d2e068c31f4737b9525e5201b824ac40cac6a337224856b56bd1ddd866334bbfb92a9f57cd6f66bc3f18d3d86fc0fe50
languageName: node
linkType: hard
"tmp@npm:^0.2.3": "tmp@npm:^0.2.3":
version: 0.2.3 version: 0.2.3
resolution: "tmp@npm:0.2.3" resolution: "tmp@npm:0.2.3"
@ -7711,6 +7848,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"xtend@npm:~4.0.1":
version: 4.0.2
resolution: "xtend@npm:4.0.2"
checksum: ac5dfa738b21f6e7f0dd6e65e1b3155036d68104e67e5d5d1bde74892e327d7e5636a076f625599dc394330a731861e87343ff184b0047fef1360a7ec0a5a36a
languageName: node
linkType: hard
"y18n@npm:^5.0.5": "y18n@npm:^5.0.5":
version: 5.0.8 version: 5.0.8
resolution: "y18n@npm:5.0.8" resolution: "y18n@npm:5.0.8"