Skip to content

Commit ded2f55

Browse files
authored
Merge pull request #428 from crazy-max/buildx-fix-convert-warnings
buildx: use Buffer for base64 encoding of the Dockerfile
2 parents 7c54753 + e979592 commit ded2f55

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

__tests__/.fixtures/lint.Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
frOM busybox as base
1818
cOpy lint.Dockerfile .
1919

20+
# some special chars: distroless/python3-debian12のPythonは3.11
21+
# https://github.com/docker/build-push-action/issues/1204#issuecomment-2274056016
22+
2023
from scratch
2124
2225
COPy --from=base \

src/buildx/buildx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ export class Buildx {
347347
if (Util.isPathRelativeTo(workspaceDir, ls.DockerfilePath)) {
348348
dockerfiles.push({
349349
path: path.relative(workspaceDir, ls.DockerfilePath),
350-
content: btoa(fs.readFileSync(ls.DockerfilePath, {encoding: 'utf-8'}))
350+
content: Buffer.from(fs.readFileSync(ls.DockerfilePath, {encoding: 'utf-8'}), 'utf-8').toString('base64')
351351
});
352352
} else {
353353
core.debug(`Buildx.convertWarningsToGitHubAnnotations: skipping Dockerfile outside of workspace: ${ls.DockerfilePath}`);

0 commit comments

Comments
 (0)