Compare commits

...

6 Commits

Author SHA1 Message Date
CrazyMax 18fbdb317a
Merge 4d56188b3d into e2a9378e4f 2024-04-13 13:01:58 +00:00
CrazyMax 4d56188b3d
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-13 15:01:52 +02:00
CrazyMax 1765b1e310
throw error message instead of exit code
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-13 15:00:01 +02:00
CrazyMax e2a9378e4f
Merge pull request #131 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.21.1
build(deps): bump @docker/actions-toolkit from 0.21.0 to 0.21.1
2024-04-12 15:12:41 +02:00
CrazyMax 3126c2341a
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-12 15:09:23 +02:00
dependabot[bot] 40ab895871
build(deps): bump @docker/actions-toolkit from 0.21.0 to 0.21.1
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.21.0 to 0.21.1.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.21.0...v0.21.1)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-12 13:05:21 +00:00
5 changed files with 30 additions and 12 deletions

4
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

View File

@ -26,7 +26,7 @@
"license": "Apache-2.0",
"dependencies": {
"@actions/core": "^1.10.1",
"@docker/actions-toolkit": "^0.21.0"
"@docker/actions-toolkit": "^0.21.1"
},
"devDependencies": {
"@types/node": "^20.5.9",

View File

@ -20,15 +20,33 @@ actionsToolkit.run(
});
await core.group(`Pulling binfmt Docker image`, async () => {
await Exec.exec('docker', ['pull', input.image]);
await Exec.getExecOutput('docker', ['pull', input.image], {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
}
});
});
await core.group(`Image info`, async () => {
await Exec.exec('docker', ['image', 'inspect', input.image]);
await Exec.getExecOutput('docker', ['image', 'inspect', input.image], {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
}
});
});
await core.group(`Installing QEMU static binaries`, async () => {
await Exec.exec('docker', ['run', '--rm', '--privileged', input.image, '--install', input.platforms]);
await Exec.getExecOutput('docker', ['run', '--rm', '--privileged', input.image, '--install', input.platforms], {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
}
});
});
await core.group(`Extracting available platforms`, async () => {
@ -37,7 +55,7 @@ actionsToolkit.run(
silent: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.trim());
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
}
const platforms: Platforms = JSON.parse(res.stdout.trim());
core.info(`${platforms.supported.join(',')}`);

View File

@ -664,10 +664,10 @@
dependencies:
"@jridgewell/trace-mapping" "0.3.9"
"@docker/actions-toolkit@^0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@docker/actions-toolkit/-/actions-toolkit-0.21.0.tgz#f41906032fb3d005733e0858448135b7aab605ee"
integrity sha512-m0Mh+tqZAF4uGrtUF7plJbnE6mVowKt/FVHfe/juVeHnFj5kH8yRh/3MC66BjD53sy7UQlI0DlPUBxX+YouCsA==
"@docker/actions-toolkit@^0.21.1":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@docker/actions-toolkit/-/actions-toolkit-0.21.1.tgz#d4a4630d117dcb2f040e121e1f918c0b19ceebf8"
integrity sha512-JPdPr9AesJQ47kRB+ylGdCxTisEL5ptOtqeGGtpXZjX7zb3S//2EmptiNDV+G5F2LrMvnCz67ZZGipf0LGDPJQ==
dependencies:
"@actions/cache" "^3.2.4"
"@actions/core" "^1.10.1"