Skip to content

Commit 79c67ac

Browse files
committed
fix: Update 'fix' action to use an 'issue_urls' input (instead of 'issue_numbers')
1 parent 0cbe506 commit 79c67ac

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

.github/actions/file/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ List of potential accessibility gaps (plus issue URLs), as stringified JSON. For
3838

3939
#### `closed_issue_urls`
4040

41-
List of URLs for closed issues, as stringified JSON. For example: `'[123, 124, 126, 127]'`.
41+
List of URLs for closed issues, 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"]'`.
4242

4343
#### `opened_issue_urls`
4444

45-
List of URLs for newly-opened issues, as stringified JSON. For example: `'[123, 124, 126, 127]'`.
45+
List of URLs for newly-opened issues, 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"]'`.
4646

4747
#### `repeated_issue_urls`
4848

49-
List of URLs for repeated issues, as stringified JSON. For example: `'[123, 124, 126, 127]'`.
49+
List of URLs for repeated issues, 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"]'`.

.github/actions/fix/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Attempts to fix issues with Copilot.
66

77
### Inputs
88

9-
#### `issue_numbers`
9+
#### `issue_urls`
1010

11-
**Required** List of issue numbers to attempt to fix, as stringified JSON. For example: `'[123, 124, 126, 127]'`.
11+
**Required** 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"]'`.
1212

1313
#### `repository`
1414

.github/actions/fix/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: "Fix"
22
description: "Attempts to fix issues with Copilot."
33

44
inputs:
5-
issue_numbers:
6-
description: "List of issue numbers to attempt to fix, as stringified JSON"
5+
issue_urls:
6+
description: "List of issue URLs to attempt to fix, as stringified JSON"
77
required: true
88
repository:
99
description: "Repository (with owner) containing issues"

.github/actions/fix/src/fixIssue.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import type { Octokit } from '@octokit/core';
22

33
// https://docs.github.com/en/enterprise-cloud@latest/copilot/how-tos/use-copilot-agents/coding-agent/assign-copilot-to-an-issue#assigning-an-existing-issue
4-
export async function fixIssue(octokit: Octokit, repoWithOwner: string, issueNumber: number) {
4+
export async function fixIssue(octokit: Octokit, repoWithOwner: string, issueUrl: string) {
55
const owner = repoWithOwner.split('/')[0];
66
const repo = repoWithOwner.split('/')[1];
7+
const issueNumber = issueUrl.split('/').pop();
78
// Check whether issues can be assigned to Copilot
89
const suggestedActorsResponse = await octokit.graphql<{
910
repository: {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { Octokit } from '@octokit/core';
33
import { fixIssue } from "./fixIssue.js";
44

55
export default async function () {
6-
const issueNumbers = JSON.parse(core.getInput('issue_numbers', { required: true }));
6+
const issueUrls = JSON.parse(core.getInput('issue_urls', { required: true }));
77
const repoWithOwner = core.getInput('repository', { required: true });
88
const token = core.getInput('token', { required: true });
99

1010
const octokit = new Octokit({ auth: token });
11-
for (const issueNumber of issueNumbers) {
12-
await fixIssue(octokit, repoWithOwner, issueNumber);
13-
console.log(`Assigned ${repoWithOwner}#${issueNumber} to Copilot!`);
11+
for (const issueUrl of issueUrls) {
12+
await fixIssue(octokit, repoWithOwner, issueUrl);
13+
console.log(`Assigned ${repoWithOwner}#${issueUrl.split('/').pop()} to Copilot!`);
1414
}
1515
}

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ runs:
3939
id: fix
4040
uses: github/continuous-accessibility-scanner/.github/actions/fix@smockle/cache-findings
4141
with:
42-
issue_numbers: ${{ steps.file.outputs.issue_numbers }}
42+
issue_urls: ${{ steps.file.outputs.opened_issue_urls }}
4343
repository: ${{ inputs.repository }}
4444
token: ${{ inputs.token }}
4545
- name: Save cached_findings

0 commit comments

Comments
 (0)