Skip to content

fix(deps): upgrade @actions/core from v1 to v3 with ESM migration#652

Merged
lourens-octopus merged 3 commits intomainfrom
lourens/update-core-actions-to-v3
Mar 25, 2026
Merged

fix(deps): upgrade @actions/core from v1 to v3 with ESM migration#652
lourens-octopus merged 3 commits intomainfrom
lourens/update-core-actions-to-v3

Conversation

@lourens-octopus
Copy link
Copy Markdown
Contributor

@lourens-octopus lourens-octopus commented Mar 18, 2026

[sc-138245]
Fixes DEVEX-102

  • Update @actions/core from 1.11.1 to ^3.0.0 (resolves Dependabot alert)
  • @actions/core v3 is ESM-only, requiring migration from CommonJS to ESM
  • tsconfig.json: change module to ESNext, moduleResolution to bundler, target to es2022
  • tsconfig.test.json: new test-specific tsconfig with rootDir set to project root
  • package.json: add type: module, configure jest for ESM (extensionsToTreatAsEsm, useESM)
  • Update test scripts to use node --experimental-vm-modules
  • Rename renovate-config.js to renovate-config.cjs (uses module.exports, must remain CJS)
  • Update tsconfig.eslint.json to reference renovate-config.cjs

Successful run: https://github.com/OctopusDeployTesting/devex-action-tests/actions/runs/23227313099

@lourens-octopus lourens-octopus requested a review from a team as a code owner March 18, 2026 01:09
@lourens-octopus lourens-octopus force-pushed the lourens/update-core-actions-to-v3 branch 2 times, most recently from 62d11fc to d531fb0 Compare March 18, 2026 02:42
- Update @actions/core from 1.11.1 to ^3.0.0 (resolves Dependabot alert)
- @actions/core v3 is ESM-only, requiring migration from CommonJS to ESM
- tsconfig.json: change module to ESNext, moduleResolution to bundler, target to es2022
- tsconfig.test.json: new test-specific tsconfig with rootDir set to project root
- package.json: add type: module, configure jest for ESM (extensionsToTreatAsEsm, useESM)
- Update test scripts to use node --experimental-vm-modules
- Rename renovate-config.js to renovate-config.cjs (uses module.exports, must remain CJS)
- Update tsconfig.eslint.json to reference renovate-config.cjs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lourens-octopus lourens-octopus force-pushed the lourens/update-core-actions-to-v3 branch from d531fb0 to cff9027 Compare March 18, 2026 03:00
ncc produces a hybrid bundle (CJS shim wrapped in an ESM entry) when the
input is ESM, which Node.js v24 auto-detects as ESM and fails on
__dirname. esbuild correctly bundles ESM dependencies into a plain CJS
output ('use strict' at top, no import statements) without needing a
dist/package.json.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How come we need to convert the file type here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Renovate config uses module.exports which is incompatible with ESM. Explicitly marking it as cjs allows it to keep it even in an ESM project

@lourens-octopus lourens-octopus merged commit aee6395 into main Mar 25, 2026
8 checks passed
@lourens-octopus lourens-octopus deleted the lourens/update-core-actions-to-v3 branch March 25, 2026 20:01
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.

2 participants