Upgrade @actions/github to ^9.0.0 and @octokit/request-error to ^7.1.… · dependabot/fetch-metadata@13d8274 · GitHub
Skip to content

Commit 13d8274

Browse files
authored
Upgrade @actions/github to ^9.0.0 and @octokit/request-error to ^7.1.0 (#678)
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).
1 parent b603099 commit 13d8274

9 files changed

Lines changed: 5414 additions & 22409 deletions

File tree

dist/index.js

Lines changed: 5197 additions & 22132 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 203 additions & 270 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions

src/dependabot/github-context.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as github from '@actions/github'
2+
3+
// Re-export the Context type derived from the context singleton.
4+
// @actions/github v9 does not export the Context class directly from its exports map.
5+
export type Context = typeof github.context
6+
7+
// The Context constructor (used in dry-run and tests to create fresh instances)
8+
export const Context = github.context.constructor as new () => Context

src/dependabot/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Context } from '@actions/github/lib/context'
1+
import type { Context } from './github-context'
22

33
export function parseNwo (nwo: string): {owner: string; repo: string} {
44
const [owner, name] = nwo.split('/')

src/dependabot/verified_commits.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as github from '@actions/github'
22
import * as core from '@actions/core'
33
import nock from 'nock'
4-
import { Context } from '@actions/github/lib/context'
4+
import { Context } from './github-context'
55
import { getAlert, getMessage, trimSlashes, getCompatibility } from './verified_commits'
66

77
beforeAll(() => {

src/dependabot/verified_commits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as core from '@actions/core'
22
import { GitHub } from '@actions/github/lib/utils'
3-
import { Context } from '@actions/github/lib/context'
3+
import type { Context } from './github-context'
44
import type { dependencyAlert } from './update_metadata'
55
import https from 'https'
66

src/dry-run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import * as github from '@actions/github'
3-
import { Context } from '@actions/github/lib/context'
3+
import { Context } from './dependabot/github-context'
44
import * as dotenv from 'dotenv'
55
import { Argv } from 'yargs'
66
import { hideBin } from 'yargs/helpers'

src/main.test.ts

Lines changed: 0 additions & 1 deletion

0 commit comments

Comments
 (0)