Skip to content

ESM-only with updated @octokit dependencies#2260

Merged
lokesh755 merged 1 commit intomainfrom
lokesh755-actions-github-v9-esm
Jan 27, 2026
Merged

ESM-only with updated @octokit dependencies#2260
lokesh755 merged 1 commit intomainfrom
lokesh755-actions-github-v9-esm

Conversation

@lokesh755
Copy link
Contributor

@lokesh755 lokesh755 commented Jan 27, 2026

Summary

Migrate @actions/github to ESM-only (v9.0.0) to properly support @octokit/core v7's type exports and resolve TypeScript compilation issues.

Motivation

The v8.0.0 release upgraded @octokit dependencies but had broken TypeScript types because @octokit/core v7 is ESM-only and its type exports (OctokitOptions, OctokitPlugin) can only be properly imported using moduleResolution: "node16". Converting @actions/github to ESM resolves this.

Breaking Changes

  • ESM-only: @actions/github v9.0.0 is now ESM-only
    • CommonJS consumers must use dynamic import():
      async function main() {
          const { getOctokit, context } = await import('@actions/github');
      }
      main();

Fixes: #2254

@lokesh755 lokesh755 requested a review from a team as a code owner January 27, 2026 16:53
Copilot AI review requested due to automatic review settings January 27, 2026 16:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Converts @actions/github to an ESM-only package (v9.0.0) and updates Octokit type references to use the supported @octokit/core/types entrypoint.

Changes:

  • Switch package publishing/runtime to ESM (type: module, exports, TS module/moduleResolution: node16, add .js extensions in internal imports).
  • Fix public type references by importing Octokit types from @octokit/core/types.
  • Update Jest config/tests and docs/release notes for the ESM-only breaking change.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/github/tsconfig.json Switch TS emit/resolution to Node16 ESM semantics.
packages/github/src/utils.ts Update local imports to .js and adjust Octokit type import path.
packages/github/src/internal/utils.ts Adjust Octokit type import path to supported entrypoint.
packages/github/src/github.ts Update local imports to .js and Octokit type imports.
packages/github/src/context.ts Update local import to .js for ESM runtime compatibility.
packages/github/package.json Mark package as ESM-only, add exports, bump version to 9.0.0, adjust test script.
packages/github/package-lock.json Bump locked package version to 9.0.0.
packages/github/jest.config.js Convert Jest config to ESM + enable ts-jest ESM mode and .js import mapping.
packages/github/tests/lib.test.ts Update tests to ESM-friendly patterns (import.meta.url, no require).
packages/github/RELEASES.md Document v9.0.0 breaking change and type fix.
packages/github/README.md Document ESM-only usage and update examples.
Files not reviewed (1)
  • packages/github/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lokesh755 lokesh755 force-pushed the lokesh755-actions-github-v9-esm branch from d622f93 to 21b33ca Compare January 27, 2026 17:03
@lokesh755 lokesh755 force-pushed the lokesh755-actions-github-v9-esm branch from 5309251 to 3546b6e Compare January 27, 2026 20:09
@lokesh755 lokesh755 force-pushed the lokesh755-actions-github-v9-esm branch from f46aecc to b05d26b Compare January 27, 2026 20:35
@lokesh755 lokesh755 merged commit a2986ee into main Jan 27, 2026
16 of 17 checks passed
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.

Broken types upgrading to @actions/github v8

2 participants