Skip to content

Commit ce82890

Browse files
authored
BREAKING CHANGE(Fix): Remove deprecated input (#1785)
Fixes github/continuous-ai-for-accessibility#46 (Hubber access only) Follow-up to github-community-projects/continuous-ai-for-accessibility-scanner#906 This PR: - Removes Fix’s deprecated `issue_urls` input. - Makes Fix’s `issues` input required.
2 parents 33b91d6 + c48b648 commit ce82890

File tree

3 files changed

+5
-25
lines changed

3 files changed

+5
-25
lines changed

.github/actions/fix/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ Attempts to fix issues with Copilot.
88

99
#### `issues`
1010

11-
**NOTE: This input will be unconditionally required in `v2`.** **Required if `issue_urls` is not provided** List of issues to attempt to fix—including, at a minimum, their `url`s—as stringified JSON. For example: `'[{"url":"https://github.com/github/docs/issues/123"},{"nodeId":"SXNzdWU6Mg==","url":"https://github.com/github/docs/issues/124"},{"id":4,"nodeId":"SXNzdWU6NA==","url":"https://github.com/github/docs/issues/126","title":"Accessibility issue: 4"}]'`.
12-
13-
#### `issue_urls`
14-
15-
**DEPRECATED: This input will be removed in `v2`.** **Required if `issues` is not provided** List of issue URLs to attempt to fix, as stringified JSON. For example: `'["https://github.com/github/docs/issues/123","https://github.com/github/docs/issues/124","https://github.com/github/docs/issues/126","https://github.com/github/docs/issues/127"]'`. If both `issues` and `issue_urls` are provided, `issue_urls` will be ignored.
11+
**Required** List of issues to attempt to fix—including, at a minimum, their `url`s—as stringified JSON. For example: `'[{"url":"https://github.com/github/docs/issues/123"},{"nodeId":"SXNzdWU6Mg==","url":"https://github.com/github/docs/issues/124"},{"id":4,"nodeId":"SXNzdWU6NA==","url":"https://github.com/github/docs/issues/126","title":"Accessibility issue: 4"}]'`.
1612

1713
#### `repository`
1814

.github/actions/fix/action.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ description: "Attempts to fix issues with Copilot."
44
inputs:
55
issues:
66
description: "List of issues to attempt to fix, as stringified JSON"
7-
required: false
8-
issue_urls:
9-
description: "List of issue URLs to attempt to fix, as stringified JSON"
10-
required: false
7+
required: true
118
repository:
129
description: "Repository (with owner) containing issues"
1310
required: true

.github/actions/fix/src/index.ts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,12 @@ const OctokitWithThrottling = Octokit.plugin(throttling);
99

1010
export default async function () {
1111
core.info("Started 'fix' action");
12-
/** @deprecated Use `issues` instead. */
13-
const issueUrls: string[] | null = JSON.parse(
14-
core.getInput("issue_urls", { required: false }) || "null"
12+
const issues: IssueInput[] = JSON.parse(
13+
core.getInput("issues", { required: true }) || "[]"
1514
);
16-
const issues: IssueInput[] | null = JSON.parse(
17-
core.getInput("issues", { required: false }) || "null"
18-
);
19-
if (issueUrls === null && issues === null) {
20-
core.setFailed(
21-
"Neither 'issues' nor 'issue_urls' was provided, but one is required."
22-
);
23-
process.exit(1);
24-
}
2515
const repoWithOwner = core.getInput("repository", { required: true });
2616
const token = core.getInput("token", { required: true });
2717
core.debug(`Input: 'issues: ${JSON.stringify(issues)}'`);
28-
core.debug(`Input: 'issue_urls: ${JSON.stringify(issueUrls)}'`);
2918
core.debug(`Input: 'repository: ${repoWithOwner}'`);
3019

3120
const octokit = new OctokitWithThrottling({
@@ -51,9 +40,7 @@ export default async function () {
5140
},
5241
},
5342
});
54-
const issueInputs: IssueInput[] =
55-
issues ?? issueUrls?.map((url) => ({ url })) ?? [];
56-
for (const issueInput of issueInputs) {
43+
for (const issueInput of issues) {
5744
try {
5845
const issue = new Issue(issueInput);
5946
await fixIssue(octokit, issue);

0 commit comments

Comments
 (0)