Skip to content

Commit b38af6e

Browse files
massongitclaudegithub-actions[bot]
authored
fix: TypeScriptのtscエラーを修正 (#2307)
* fix: tsconfig.jsonのTS5011/TS5107エラーを修正 - TS5011: rootDirが未設定だったため "./src" を追加 - TS5107: moduleResolution "node" (node10の別名) が非推奨のため TypeScript 5.0で追加された "bundler" に変更 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: bundler moduleResolutionへの対応 - tsconfig.jsonに "types": ["node"] を追加し、processグローバル型を明示的に含める - @actions/github/lib/context は exports フィールド未掲載のため、 全ソースファイルのContextインポートを @actions/github の公開APIから typeof context ベースの型に変更 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * format修正 (#2308) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent bdd6767 commit b38af6e

13 files changed

Lines changed: 61 additions & 59 deletions

dist/assign_a_user.js

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

dist/close_pull_request.js

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

dist/create_pull_request.js

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

dist/get_number_of_pull_requests.js

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

dist/get_pull_requests.js

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

dist/update_pull_request.js

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

src/assign_a_user.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import type { Context } from "@actions/github/lib/context";
1+
import type { context } from "@actions/github";
22
import type { GitHub } from "@actions/github/lib/utils";
33
import type { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
44

55
export async function script(
66
github: InstanceType<typeof GitHub>,
7-
context: Context,
7+
ctx: typeof context,
88
) {
99
const issuesAddAssigneesParams: RestEndpointMethodTypes["issues"]["addAssignees"]["parameters"] =
1010
{
11-
owner: context.repo.owner,
12-
repo: context.repo.repo,
11+
owner: ctx.repo.owner,
12+
repo: ctx.repo.repo,
1313
issue_number: Number(process.env.PR_NUMBER),
14-
assignees: [context.actor],
14+
assignees: [ctx.actor],
1515
};
1616
console.log("call issues.addAssignees:");
1717
console.log(issuesAddAssigneesParams);

src/close_pull_request.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { Context } from "@actions/github/lib/context";
1+
import type { context } from "@actions/github";
22
import type { GitHub } from "@actions/github/lib/utils";
33
import type { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
44
import { getPullRequests } from "./get_pull_requests";
55

66
export async function script(
77
github: InstanceType<typeof GitHub>,
8-
context: Context,
8+
ctx: typeof context,
99
) {
1010
const HEAD_REF = process.env.HEAD_REF;
1111
let headName = process.env.BRANCH_NAME_PREFIX;
@@ -14,12 +14,12 @@ export async function script(
1414
headName += "-" + HEAD_REF;
1515
}
1616

17-
for (const pull of await getPullRequests(github, context)) {
17+
for (const pull of await getPullRequests(github, ctx)) {
1818
// 修正PRをcloseする (修正PRのstateをclosedに更新する)
1919
const pullsUpdateParams: RestEndpointMethodTypes["pulls"]["update"]["parameters"] =
2020
{
21-
owner: context.repo.owner,
22-
repo: context.repo.repo,
21+
owner: ctx.repo.owner,
22+
repo: ctx.repo.repo,
2323
pull_number: pull.number,
2424
state: "closed",
2525
};
@@ -29,8 +29,8 @@ export async function script(
2929
// 修正PRのブランチを削除する
3030
const gitDeleteRefParams: RestEndpointMethodTypes["git"]["deleteRef"]["parameters"] =
3131
{
32-
owner: context.repo.owner,
33-
repo: context.repo.repo,
32+
owner: ctx.repo.owner,
33+
repo: ctx.repo.repo,
3434
ref: "heads/" + headName,
3535
};
3636
console.log("call git.deleteRef:", gitDeleteRefParams);

src/create_pull_request.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { Context } from "@actions/github/lib/context";
1+
import type { context } from "@actions/github";
22
import type { GitHub } from "@actions/github/lib/utils";
33
import type { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
44
import { generateTitleDescription } from "./generate_title_description";
55

66
export async function script(
77
github: InstanceType<typeof GitHub>,
8-
context: Context,
8+
ctx: typeof context,
99
): Promise<number> {
1010
const HEAD_REF = process.env.HEAD_REF || "";
1111
let head = process.env.BRANCH_NAME_PREFIX;
@@ -14,12 +14,12 @@ export async function script(
1414
head += "-" + HEAD_REF;
1515
}
1616

17-
const headWithRepo = context.repo.owner + ":" + head;
17+
const headWithRepo = ctx.repo.owner + ":" + head;
1818
const { title, body } = generateTitleDescription();
1919
const pullsCreateParams: RestEndpointMethodTypes["pulls"]["create"]["parameters"] =
2020
{
21-
owner: context.repo.owner,
22-
repo: context.repo.repo,
21+
owner: ctx.repo.owner,
22+
repo: ctx.repo.repo,
2323
head: headWithRepo,
2424
base: HEAD_REF,
2525
title,

src/get_number_of_pull_requests.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import type { Context } from "@actions/github/lib/context";
1+
import type { context } from "@actions/github";
22
import type { GitHub } from "@actions/github/lib/utils";
33
import { getPullRequests } from "./get_pull_requests";
44

55
export async function script(
66
github: InstanceType<typeof GitHub>,
7-
context: Context,
7+
ctx: typeof context,
88
): Promise<number> {
99
const HEAD_REF = process.env.HEAD_REF;
10-
const pulls = await getPullRequests(github, context, HEAD_REF);
10+
const pulls = await getPullRequests(github, ctx, HEAD_REF);
1111
return pulls.length;
1212
}

0 commit comments

Comments
 (0)