Skip to content

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

Open
Copilot wants to merge 4 commits intomainfrom
copilot/upgrade-actions-github-and-octokit
Open

Upgrade @actions/github to v9 and @octokit/core to v7+#708
Copilot wants to merge 4 commits intomainfrom
copilot/upgrade-actions-github-and-octokit

Conversation

Copy link
Contributor

Copilot AI commented Mar 23, 2026

Upgrades @actions/github from v6 to v9 and @octokit/core from v5 to v7, which are ESM-only packages requiring TypeScript module resolution changes.

Dependency versions

Package Old New
@actions/github ^6.0.0 ^9.0.0
@octokit/core ^5.0.1 ^7.0.0
@octokit/plugin-request-log ^4.0.0 ^6.0.0
@octokit/plugin-retry ^6.0.1 ^8.0.0

TypeScript config (tsconfig.json)

  • moduleResolution: "bundler" — required for ESM exports map resolution in @octokit/core v7 and @actions/github v9
  • module: "es2022" — required by bundler resolution
  • target: "es2022" — needed for ErrorOptions type used in @octokit/request-error
  • ts-jest configured with module: "commonjs" override to preserve CJS test execution

Import path fixes

  • src/retry-options.ts: @octokit/core/dist-types/types@octokit/core/types (v7 subpath export)
  • src/async-function.ts: @actions/github/lib/context is no longer in the v9 exports map. Replaced with typeof context derived from @actions/github/lib/utils:
// Before
import {Context} from '@actions/github/lib/context'
import {GitHub} from '@actions/github/lib/utils'
// ...
context: Context

// After
import {context as _ghContext, GitHub} from '@actions/github/lib/utils'
// ...
context: typeof _ghContext

Build script

Updated build:types to pass --target es2022 --module es2022 --moduleResolution bundler since it specifies files directly (bypasses tsconfig.json).


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- @actions/github: ^6.0.0 → ^9.0.0
- @octokit/core: ^5.0.1 → ^7.0.0
- @octokit/plugin-request-log: ^4.0.0 → ^6.0.0
- @octokit/plugin-retry: ^6.0.1 → ^8.0.0
- Update tsconfig.json to use moduleResolution: "bundler" for ESM exports map support
- Update import paths for new package structures
- Update build:types script for compatible compiler options

Co-authored-by: angel-jiakou <115738347+angel-jiakou@users.noreply.github.com>
Agent-Logs-Url: https://github.com/actions/github-script/sessions/17de5ca1-8bdc-41e4-a06d-ab2d8c2e6e8c
Copilot AI changed the title [WIP] Upgrade @actions/github to v9 and @octokit/core to v7 Upgrade @actions/github to v9 and @octokit/core to v7+ Mar 23, 2026
Copilot AI requested a review from angel-jiakou March 23, 2026 20:29
Copilot AI temporarily deployed to debug-integration-test March 23, 2026 20:33 Inactive
@github-actions
Copy link

github-actions bot commented Mar 23, 2026

Hello from actions/github-script! (f3724d5)

@angel-jiakou angel-jiakou temporarily deployed to debug-integration-test March 23, 2026 23:08 — with GitHub Actions Inactive
@angel-jiakou angel-jiakou deployed to debug-integration-test March 23, 2026 23:30 — with GitHub Actions Active
@angel-jiakou angel-jiakou marked this pull request as ready for review March 23, 2026 23:33
@angel-jiakou angel-jiakou requested a review from a team as a code owner March 23, 2026 23:33
Copilot AI review requested due to automatic review settings March 23, 2026 23:33
Copy link

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

Upgrades the Action’s GitHub/Octokit dependencies to ESM-only major versions and updates the TypeScript + test/build configuration and import paths to remain compatible.

Changes:

  • Upgrade @actions/github to v9 and @octokit/* dependencies to their v6/v7/v8 major versions.
  • Update TypeScript compilation settings for ESM (target/module es2022, moduleResolution: bundler) and adjust ts-jest to keep tests running in CJS.
  • Fix type/import paths impacted by the new packages’ exports maps and relax integration workflow user-agent assertions.

Reviewed changes

Copilot reviewed 28 out of 34 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
types/async-function.d.ts Updates exported argument types to avoid removed @actions/github/lib/context path.
tsconfig.json Switches project TS target/module to ES2022 and module resolution to bundler.
src/retry-options.ts Updates Octokit type import to the new v7 exported subpath.
src/async-function.ts Adjusts context typing approach to match @actions/github v9 export map changes.
package.json Bumps deps, updates build:types, and adds ts-jest TS overrides.
package-lock.json Lockfile updates for the new dependency graph and transitive packages.
.licenses/npm/wrappy.dep.yml Removes cached license entry (dependency no longer in licensed set).
.licenses/npm/universal-user-agent.dep.yml Updates cached license metadata version for transitive bump.
.licenses/npm/undici-6.24.1.dep.yml Corrects cached license metadata to match undici@6.24.1.
.licenses/npm/undici-5.28.5.dep.yml Adds cached license metadata for undici@5.28.5.
.licenses/npm/once.dep.yml Removes cached license entry (dependency no longer in licensed set).
.licenses/npm/json-with-bigint.dep.yml Adds cached license metadata for new transitive dependency.
.licenses/npm/fast-content-type-parse.dep.yml Adds cached license metadata for new transitive dependency.
.licenses/npm/deprecation.dep.yml Removes cached license entry (dependency removed from graph).
.licenses/npm/before-after-hook.dep.yml Updates cached license metadata version for transitive bump.
.licenses/npm/@octokit/types.dep.yml Updates cached license metadata version for transitive bump.
.licenses/npm/@octokit/types-12.0.0.dep.yml Removes cached license entry for superseded version.
.licenses/npm/@octokit/request.dep.yml Updates cached license metadata version for transitive bump.
.licenses/npm/@octokit/request-error.dep.yml Updates cached license metadata version for transitive bump.
.licenses/npm/@octokit/plugin-retry.dep.yml Updates cached license metadata version for transitive bump.
.licenses/npm/@octokit/plugin-rest-endpoint-methods.dep.yml Updates cached license metadata version for transitive bump.
.licenses/npm/@octokit/plugin-request-log.dep.yml Updates cached license metadata version for transitive bump.
.licenses/npm/@octokit/plugin-paginate-rest.dep.yml Updates cached license metadata version for transitive bump.
.licenses/npm/@octokit/openapi-types.dep.yml Updates cached license metadata version for transitive bump.
.licenses/npm/@octokit/openapi-types-19.0.0.dep.yml Removes cached license entry for superseded version.
.licenses/npm/@octokit/graphql.dep.yml Updates cached license metadata version for transitive bump.
.licenses/npm/@octokit/endpoint.dep.yml Updates cached license metadata version for transitive bump.
.licenses/npm/@octokit/core.dep.yml Updates cached license metadata version for direct dependency bump.
.licenses/npm/@octokit/auth-token.dep.yml Updates cached license metadata version for transitive bump.
.licenses/npm/@actions/http-client-3.0.2.dep.yml Adds cached license metadata for new transitive version.
.licenses/npm/@actions/http-client-2.2.0.dep.yml Adds cached license metadata for existing transitive version.
.licenses/npm/@actions/github.dep.yml Updates cached license metadata version for direct dependency bump.
.github/workflows/integration.yml Adjusts user-agent integration assertions to allow the new user-agent format.

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

Comment on lines +3 to 4
import {context as _ghContext, GitHub} from '@actions/github/lib/utils'
import * as glob from '@actions/glob'
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

@actions/github/lib/utils is a deep import that isn’t part of the stable public API surface and has already changed once (lib/context disappeared in v9). Since this import is only used to derive types, prefer using public exports from @actions/github (e.g., typeof context for context and ReturnType<typeof getOctokit> for github/octokit) and make the import type-only so it can’t accidentally become a runtime dependency.

Copilot uses AI. Check for mistakes.
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.

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

4 participants