Skip to content

Upgrade @actions/github to v9 and @octokit/core to v7+ #707

@angel-jiakou

Description

@angel-jiakou

Summary

Upgrade the @actions/github dependency from v6.0.0 to v9.0.0 and @octokit/core from v5.0.1 to v7.0.6 (latest).

Current State

Package Current Version Latest Version
@actions/github ^6.0.0 (resolved: 6.0.0) 9.0.0
@octokit/core ^5.0.1 (resolved: 5.0.1) 7.0.6

Motivation

  • The current dependencies are several major versions behind.
  • @actions/github v9 ships with the latest Octokit APIs, newer GitHub REST/GraphQL endpoint support, and security patches.
  • @octokit/core v7+ includes performance improvements and bug fixes.
  • Keeping up with upstream major releases ensures compatibility with the latest GitHub platform features and avoids accumulating migration debt.

Breaking Changes to Address

@actions/github v9 is ESM-only, which is the main breaking change. Key migration considerations:

  1. ESM-only module: require() calls must be replaced with import statements. Since this repo already uses TypeScript with ESM-style imports, this may be partially mitigated, but bundler configuration (esbuild) should be verified.
  2. Internal import paths: Imports from @actions/github/lib/utils and @actions/github/lib/context may need updating if subpath exports have changed in v9.
  3. Plugin composition: The Octokit plugin model (@octokit/plugin-retry, @octokit/plugin-request-log) should be tested for compatibility with the new core version.
  4. TypeScript types: OctokitOptions from @octokit/core/dist-types/types and other type imports may have changed paths or shapes.
  5. Node.js version: The repo already requires Node.js >= 24, so runtime compatibility should not be an issue.

Affected Source Files

The following files import from @actions/github or @octokit/* and would need review:

  • src/main.ts — imports context, getOctokit, and defaults from @actions/github
  • src/async-function.ts — imports Context and GitHub types from @actions/github
  • src/retry-options.ts — imports OctokitOptions from @octokit/core

Suggested Approach

  1. Update package.json dependencies to @actions/github@^9.0.0 and @octokit/core@^7.0.0
  2. Run npm install and resolve any peer dependency conflicts
  3. Update import paths if subpath exports changed in v9
  4. Verify TypeScript compilation passes
  5. Verify esbuild bundling still works correctly with ESM input
  6. Run the existing test suite and fix any failures
  7. Test end-to-end in a workflow to confirm runtime behavior

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions