GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — switch to ESM and update config/test wiring by crazy-max · Pull Request #961 · docker/actions-toolkit

Conversation

@crazy-max

@crazy-max crazy-max commented Jan 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
crazy-max added 5 commits January 28, 2026 10:35
@crazy-max
switch to ESM and update config/test wiring
faa5b5b
Signed-off-by: CrazyMax <[email protected]>
@crazy-max
remove the mapper entry for csv-parse in jest config
8a49a6e
Signed-off-by: CrazyMax <[email protected]>
@crazy-max
add ESM-safe os test helpers and tsconfig for tests
3f7be6d
Signed-off-by: CrazyMax <[email protected]>
@crazy-max
git: drop types/git and inline GitHub context type
9348f81
Signed-off-by: CrazyMax <[email protected]>
@crazy-max
github: derive summary table types from core API
2617546
Signed-off-by: CrazyMax <[email protected]>
@github-actions github-actions Bot assigned crazy-max Jan 28, 2026
@crazy-max
crazy-max force-pushed the esm branch from b54938d to 2617546 Compare January 28, 2026 11:57
crazy-max
crazy-max commented Jan 28, 2026
View reviewed changes
Comment thread tsconfig.json
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"module": "es2020",

@crazy-max crazy-max Jan 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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:

actions-toolkit/src/github.ts

Lines 23 to 27 in f64486a

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@crazy-max crazy-max Jan 28, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Uh oh!

There was an error while loading. Please reload this page.

@crazy-max
crazy-max deleted the esm branch January 28, 2026 13:19
@crazy-max crazy-max mentioned this pull request Jan 28, 2026
build(deps): bump @actions/github from 7.0.0 to 9.0.0 #960
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@crazy-max crazy-max

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@crazy-max
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.