Skip to content

Conversation

@crazy-max
Copy link
Member

@crazy-max crazy-max commented Jan 28, 2026

needed for #960

https://github.com/docker/actions-toolkit/actions/runs/21432262600/job/61714304782?pr=960#step:2:333

#13 [build 1/1] RUN --mount=type=bind,target=.,rw   --mount=type=cache,target=/src/.yarn/cache   --mount=type=cache,target=/src/node_modules   yarn run build && mkdir /out && cp -Rf lib /out/
#13 11.52 node_modules/@actions/github/node_modules/@octokit/request-error/dist-types/types.d.ts(2,46): error TS2304: Cannot find name 'ErrorOptions'.
#13 11.52 src/context.ts(21,25): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@actions/github")' call instead.
#13 11.52   To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `"type": "module"` to '/src/package.json'.
#13 11.52 src/git.ts(23,23): error TS2307: Cannot find module '@actions/github/lib/context' or its corresponding type declarations.
#13 11.52 src/github.ts(31,25): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@actions/github")' call instead.
#13 11.52   To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `"type": "module"` to '/src/package.json'.
#13 11.52 src/github.ts(32,33): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@actions/github/lib/utils")' call instead.
#13 11.52   To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `"type": "module"` to '/src/package.json'.
#13 11.52 src/github.ts(33,23): error TS2307: Cannot find module '@actions/github/lib/context' or its corresponding type declarations.
#13 11.52 src/types/git.ts(17,40): error TS2307: Cannot find module '@actions/github/lib/context' or its corresponding type declarations.
#13 ERROR: process "/bin/sh -c yarn run build && mkdir /out && cp -Rf lib /out/" did not complete successfully: exit code: 2

@@ -1,8 +1,8 @@
{
"compilerOptions": {
"module": "es2020",
Copy link
Member Author

@crazy-max crazy-max Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't use nodenext yet because of @actions/artifact/lib imports:

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

Tried to vendor it but then Jest fails so would need to migrate Jest which will be used to transform files into valid JS based on Babel configuration without need of ts-type.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be easily solved in the future with actions/toolkit#2256

@crazy-max crazy-max marked this pull request as ready for review January 28, 2026 12:15
@crazy-max crazy-max merged commit 06cdb94 into docker:main Jan 28, 2026
295 of 303 checks passed
@crazy-max crazy-max deleted the esm branch January 28, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant