Skip to content

Commit

Permalink
format修正
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 17, 2024
1 parent bd4c936 commit c361da7
Show file tree
Hide file tree
Showing 16 changed files with 158 additions and 213 deletions.
3 changes: 1 addition & 2 deletions dist/assign_a_user.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 26 additions & 38 deletions dist/close_pull_request.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 20 additions & 32 deletions dist/create_pull_request.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions dist/generate_title_description.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 5 additions & 17 deletions dist/get_number_of_pull_requests.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions dist/get_pull_requests.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 17 additions & 29 deletions dist/update_pull_request.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions scripts/format/format/get_inputs_markdown.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {readFileSync} from "fs";
import { readFileSync } from "fs";
import * as yaml from "js-yaml";

export function script(): string {
const ymlFile = yaml.load(readFileSync("action.yml", "utf8")) as {
inputs: {
[p: string]: {
description: string
default: string
required: "true" | "false"
}
}
inputs: {
[p: string]: {
description: string;
default: string;
required: "true" | "false";
};
};
};
const inputs = ymlFile.inputs;
const rows = [
Expand Down
19 changes: 10 additions & 9 deletions src/assign_a_user.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import type { Context } from "@actions/github/lib/context";
import type { GitHub } from "@actions/github/lib/utils";
import type {RestEndpointMethodTypes} from "@octokit/plugin-rest-endpoint-methods";
import type { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";

export async function script(
github: InstanceType<typeof GitHub>,
context: Context,
github: InstanceType<typeof GitHub>,
context: Context,
) {
const issuesAddAssigneesParams:RestEndpointMethodTypes["issues"]["addAssignees"]["parameters"] = {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: Number(process.env.PR_NUMBER),
assignees: [context.actor],
};
const issuesAddAssigneesParams: RestEndpointMethodTypes["issues"]["addAssignees"]["parameters"] =
{
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: Number(process.env.PR_NUMBER),
assignees: [context.actor],
};
console.log("call issues.addAssignees:");
console.log(issuesAddAssigneesParams);
await github.rest.issues.addAssignees(issuesAddAssigneesParams);
Expand Down
32 changes: 17 additions & 15 deletions src/close_pull_request.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Context } from "@actions/github/lib/context";
import type { GitHub } from "@actions/github/lib/utils";
import type {RestEndpointMethodTypes} from "@octokit/plugin-rest-endpoint-methods";
import {getPullRequests} from "./get_pull_requests";
import type { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
import { getPullRequests } from "./get_pull_requests";

export async function script(
github: InstanceType<typeof GitHub>,
context: Context,
github: InstanceType<typeof GitHub>,
context: Context,
) {
const HEAD_REF = process.env.HEAD_REF;
let headName = process.env.BRANCH_NAME_PREFIX;
Expand All @@ -16,21 +16,23 @@ export async function script(

for (const pull of await getPullRequests(github, context)) {
// 修正PRをcloseする (修正PRのstateをclosedに更新する)
const pullsUpdateParams:RestEndpointMethodTypes["pulls"]["update"]["parameters"] = {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pull.number,
state: "closed",
};
const pullsUpdateParams: RestEndpointMethodTypes["pulls"]["update"]["parameters"] =
{
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pull.number,
state: "closed",
};
console.log("call pulls.update:", pullsUpdateParams);
await github.rest.pulls.update(pullsUpdateParams);

// 修正PRのブランチを削除する
const gitDeleteRefParams:RestEndpointMethodTypes["git"]["deleteRef"]["parameters"] = {
owner: context.repo.owner,
repo: context.repo.repo,
ref: "heads/" + headName,
};
const gitDeleteRefParams: RestEndpointMethodTypes["git"]["deleteRef"]["parameters"] =
{
owner: context.repo.owner,
repo: context.repo.repo,
ref: "heads/" + headName,
};
console.log("call git.deleteRef:", gitDeleteRefParams);
await github.rest.git.deleteRef(gitDeleteRefParams);
}
Expand Down
21 changes: 11 additions & 10 deletions src/create_pull_request.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Context } from "@actions/github/lib/context";
import type { GitHub } from "@actions/github/lib/utils";
import type {RestEndpointMethodTypes} from "@octokit/plugin-rest-endpoint-methods";
import {generateTitleDescription} from "./generate_title_description";
import type { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
import { generateTitleDescription } from "./generate_title_description";

export async function script(
github: InstanceType<typeof GitHub>,
Expand All @@ -16,14 +16,15 @@ export async function script(

const headWithRepo = context.repo.owner + ":" + head;
const { title, body } = generateTitleDescription();
const pullsCreateParams:RestEndpointMethodTypes["pulls"]["create"]["parameters"] = {
owner: context.repo.owner,
repo: context.repo.repo,
head: headWithRepo,
base: HEAD_REF,
title,
body,
};
const pullsCreateParams: RestEndpointMethodTypes["pulls"]["create"]["parameters"] =
{
owner: context.repo.owner,
repo: context.repo.repo,
head: headWithRepo,
base: HEAD_REF,
title,
body,
};
console.log("call pulls.create:", pullsCreateParams);
const createPullRes = await github.rest.pulls.create(pullsCreateParams);
return createPullRes.data.number;
Expand Down
Loading

0 comments on commit c361da7

Please sign in to comment.