close
Skip to content

Upgrade @actions/github to ^9.0.0 and @octokit/request-error to ^7.1.0#678

Merged
truggeri merged 1 commit into
mainfrom
upgrade-actions-github
Mar 26, 2026
Merged

Upgrade @actions/github to ^9.0.0 and @octokit/request-error to ^7.1.0#678
truggeri merged 1 commit into
mainfrom
upgrade-actions-github

Conversation

@truggeri
Copy link
Copy Markdown
Contributor

@truggeri truggeri commented Mar 26, 2026

Summary

Part 3 of a larger update, see #673 .

Upgrades @actions/github from ^6.0.1 to ^9.0.0 and @octokit/request-error from ^5.1.1 to ^7.1.0.

Breaking changes

  • @actions/github 9.0.0: Package is now ESM-only. The ./lib/context subpath is no longer in the exports map, so a local github-context.ts shim is added that derives the Context type and constructor from the context singleton.
  • @octokit/request-error 7.x: headers removed from RequestErrorOptions. Updated the test constructor call in src/main.test.ts.
  • @octokit/request-error bumped to ^7.1.0 to align with the version used transitively by @actions/github 9.x (prevents instanceof mismatches).

Files changed

  • package.json / package-lock.json — Version bumps
  • src/dependabot/github-context.ts — New Context type/constructor shim
  • src/dependabot/util.ts, verified_commits.ts, verified_commits.test.ts, src/dry-run.ts — Import Context from local shim instead of @actions/github/lib/context
  • src/main.test.ts — Remove headers from RequestError constructor options
  • dist/index.js — Rebuilt bundle

Dependencies

Note: This is PR 3 of 3. Merge after #676 and #677.

@truggeri truggeri requested a review from a team as a code owner March 26, 2026 02:15
@truggeri truggeri self-assigned this Mar 26, 2026
@truggeri truggeri changed the base branch from main to upgrade-actions-core March 26, 2026 18:47
Base automatically changed from upgrade-actions-core to main March 26, 2026 18:47
jeffwidman
jeffwidman previously approved these changes Mar 26, 2026
Breaking changes addressed:
- @actions/github 9.0.0: Package is now ESM-only. The ./lib/context
  subpath is no longer in the exports map, so a local github-context.ts
  shim derives the Context type and constructor from the context singleton.
- @octokit/request-error 7.x: Removed headers from RequestErrorOptions.
  Updated test constructor call accordingly.
- @octokit/request-error bumped to ^7.1.0 to align with the version
  used transitively by @actions/github 9.x (prevents instanceof mismatches).
Copy link
Copy Markdown
Member

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

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

Let's ship this, and explore the context question later as a follow-up if interested.

import * as github from '@actions/github'

// Re-export the Context type derived from the context singleton.
// @actions/github v9 does not export the Context class directly from its exports map.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤔 I wonder why? does that hint at that we should migrate away from this direct import ourselves?

Semi-out-of-scope for this PR.

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.

Probably so.

Comment thread src/main.test.ts
jest.spyOn(util, 'getBranchNames').mockReturnValue({ headName: 'dependabot|nuget|feature1', baseName: 'main' })
jest.spyOn(dependabotCommits, 'getMessage').mockImplementation(jest.fn(
() => Promise.reject(new RequestError('Something bad happened!', 500, {
headers: {},
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.

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