Skip to content

Commit

Permalink
Remove exclude-pull-requests from action.yml
Browse files Browse the repository at this point in the history
exclude-pull-requests are just specifying for omitting `pull_requests`
from API responses. This is cofusing for users, so I just removed it.

However, the option itself might be convenient, so I leave the option
for APIClient.
  • Loading branch information
yykamei committed Mar 29, 2024
1 parent dea80c4 commit e41c137
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 20 deletions.
4 changes: 0 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ inputs:
description: Only the specified workflows will be measured. This is supposed to be comma-separated list
required: false
default: ""
exclude-pull-requests:
description: If true pull requests are omitted from the response
required: false
default: "false"
label:
description: The label for GitHub issues that the GitHub Action creates
required: false
Expand Down
7 changes: 1 addition & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29294,9 +29294,6 @@ class Input {
}
return only.split(/\s*,\s*/);
}
get excludePullRequests() {
return this.getInputFn("exclude-pull-requests").toLowerCase() === "true";
}
get token() {
return this.getInputFn("token", { required: true });
}
Expand Down Expand Up @@ -29358,9 +29355,7 @@ const main = async () => {
const repository = new GitHubRepository(input.owner, input.repo, apiClient);
const workflows = await repository.getWorkflows(input.only);
const charts = await Promise.all(workflows.map(async (w) => {
const runs = await repository.getWorkflowRuns(w, {
excludePullRequests: input.excludePullRequests,
});
const runs = await repository.getWorkflowRuns(w);
return new MermaidXYChart(w, runs);
}));
const issueContent = new GitHubIssueContent(charts, `GitHub Workflow Metrics on ${now.toDateString()}`, [], [input.label]);
Expand Down
4 changes: 0 additions & 4 deletions src/Input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ export class Input {
return only.split(/\s*,\s*/);
}

get excludePullRequests(): boolean {
return this.getInputFn("exclude-pull-requests").toLowerCase() === "true";
}

get token(): string {
return this.getInputFn("token", { required: true });
}
Expand Down
4 changes: 1 addition & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ const main = async () => {
const workflows = await repository.getWorkflows(input.only);
const charts = await Promise.all(
workflows.map(async (w) => {
const runs = await repository.getWorkflowRuns(w, {
excludePullRequests: input.excludePullRequests,
});
const runs = await repository.getWorkflowRuns(w);
return new MermaidXYChart(w, runs);
}),
);
Expand Down
3 changes: 0 additions & 3 deletions tests/Input.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ describe("Input", () => {
return "github-workflows-metrics";
case "only":
return "";
case "exclude-pull-requests":
return "false";
default:
throw new Error("Unsupported key");
}
Expand All @@ -32,7 +30,6 @@ describe("Input", () => {
expect(input.repo).toEqual("test-repo");
expect(input.label).toEqual("github-workflows-metrics");
expect(input.only).toBeNull();
expect(input.excludePullRequests).toBe(false);
expect(input.token).toEqual("my-token");
});

Expand Down

0 comments on commit e41c137

Please sign in to comment.