Skip to content

feat: convert project to ESM and bump @actions/core from 1.11.1 to 3.0.1#766

Merged
simoneb merged 6 commits into
mainfrom
dependabot/npm_and_yarn/actions/core-3.0.1
Jun 12, 2026
Merged

feat: convert project to ESM and bump @actions/core from 1.11.1 to 3.0.1#766
simoneb merged 6 commits into
mainfrom
dependabot/npm_and_yarn/actions/core-3.0.1

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github May 1, 2026

Copy link
Copy Markdown
Contributor

Bumps @actions/core from 1.11.1 to 3.0.1.

@actions/core v3 is ESM-only — its exports field has no "require" condition, making it incompatible with the project's previous CommonJS setup. This PR converts the entire project to ESM in order to support the upgrade.

Changes Made

  • package.json: Changed "type" from "commonjs" to "module", upgraded @vercel/ncc to 0.44.0 (required for ESM bundle output), added esmock, removed proxyquire, upgraded sinon to ^22.0.0
  • src/*.js: All source files converted from require/module.exports CJS syntax to import/export ESM syntax, including the new src/mergeWindow.js module (business window constraint feature)
  • eslint.config.jseslint.config.cjs: Renamed so ESLint can load it as CJS when "type": "module" is set in package.json
  • action.yml: Changed require(ACTION_PATH + '/dist/index.js') to await import('file://' + ACTION_PATH + '/dist/index.js') to load the ESM bundle; added merge-window and merge-window-timezone inputs
  • test/*.test.js: All test files converted from CJS/proxyquire to ESM/esmock, including the new test/mergeWindow.test.js
  • dist/: Rebuilt with ncc 0.44.0 which outputs an ESM bundle when the entry point is ESM

Testing

  • ✅ All 98 tests pass with 100% code coverage
  • ✅ Build succeeds (ncc 0.44.0 compiles to ESM dist/index.js)
  • ✅ Lint passes

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels May 1, 2026
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.11.1 to 3.0.1.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-version: 3.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot force-pushed the dependabot/npm_and_yarn/actions/core-3.0.1 branch from 54f2ea5 to f91b1a6 Compare May 1, 2026 09:40
@simoneb

simoneb commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

@copilot can you look into this one?

Copilot AI added 2 commits June 12, 2026 10:17
- Change package.json type from commonjs to module
- Convert all source files (src/*.js) to ESM syntax
- Rename eslint.config.js to eslint.config.cjs (must stay CJS)
- Update action.yml to use await import() instead of require()
- Replace proxyquire with esmock in all test files
- Upgrade @vercel/ncc to 0.44.0 (supports ESM bundles)
- Add esmock dev dependency, remove proxyquire
- Rebuild dist/ with ncc 0.44.0 ESM output

All 68 tests pass with 100% coverage.

Copilot AI commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@copilot can you look into this one?

The root cause is that @actions/core v3 is ESM-only (no require condition in its exports field), which broke both the runtime and the ncc bundler when the project was CJS.

The fix is a full ESM conversion of the project:

  • package.json: "type": "module", upgraded @vercel/ncc to 0.44.0 (supports ESM bundles), replaced proxyquire with esmock
  • src/*.js: All source files converted from require/module.exports to import/export ESM syntax
  • eslint.config.jseslint.config.cjs: ESLint flat config must remain CJS when "type": "module" is set
  • action.yml: Changed require(ACTION_PATH + '/dist/index.js') to await import('file://' + ACTION_PATH + '/dist/index.js')
  • test/*.test.js: All test files converted from CJS/proxyquire to ESM/esmock

All 68 tests pass with 100% code coverage and the build succeeds.

Copilot AI changed the title chore(deps): bump @actions/core from 1.11.1 to 3.0.1 feat: convert project to ESM and bump @actions/core from 1.11.1 to 3.0.1 Jun 12, 2026
Copilot AI requested a review from simoneb June 12, 2026 10:27
@simoneb

simoneb commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

lots of conflicts!

@simoneb

simoneb commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

@copilot lots of conflicts!

Copilot AI added 2 commits June 12, 2026 10:37
…rn/actions/core-3.0.1

# Conflicts:
#	dist/index.js
#	package-lock.json
#	package.json
#	src/action.js
#	test/action.test.js

Copilot AI commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@copilot lots of conflicts!

Resolved in b9d8284. Merged origin/main into the branch and addressed all conflicts:

  • src/action.js / src/util.js: kept ESM syntax and added the merge-window support from main
  • src/mergeWindow.js / test/mergeWindow.test.js: new files added from main were converted from CJS to ESM
  • test/action.test.js: added isWithinMergeWindowStub to the esmock setup and fixed the merge-window tests to await buildStubbedAction
  • package.json: kept ESM setup, upgraded sinon to ^22.0.0, dropped proxyquire
  • dist/index.js: rebuilt

All 98 tests pass with 100% coverage.

@simoneb

simoneb commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

@copilot CI is failing. please run tests and linting as part of your work

Copilot AI commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@copilot CI is failing. please run tests and linting as part of your work

Fixed in the latest commit — src/mergeWindow.js was missing a newline at end of file, causing the @stylistic/eol-last ESLint error. Lint and all 98 tests now pass locally.

@simoneb simoneb merged commit c75d537 into main Jun 12, 2026
6 checks passed
@simoneb simoneb deleted the dependabot/npm_and_yarn/actions/core-3.0.1 branch June 12, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants