Skip to content

Commit c056abf

Browse files
lindseywildCopilot
andcommitted
Remove string I/O backward compat, use file-based I/O exclusively
- Remove string inputs (findings, cached_filings, issues) and outputs (findings, filings, fixings) from find, file, fix actions - Make file inputs required (findings_file, issues_file) - Remove core.setOutput calls for string versions - Simplify TypeScript to read only from files, no fallback logic Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6d34e8d commit c056abf

File tree

6 files changed

+19
-44
lines changed

6 files changed

+19
-44
lines changed

.github/actions/file/action.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,17 @@ name: "File"
22
description: "Files GitHub issues to track potential accessibility gaps."
33

44
inputs:
5-
findings:
6-
description: "List of potential accessibility gaps, as stringified JSON"
7-
required: false
85
findings_file:
9-
description: "Path to a JSON file containing findings (alternative to 'findings' for large datasets)"
10-
required: false
6+
description: "Path to a JSON file containing the list of potential accessibility gaps"
7+
required: true
118
repository:
129
description: "Repository (with owner) to file issues in"
1310
required: true
1411
token:
1512
description: "Token with fine-grained permission 'issues: write'"
1613
required: true
17-
cached_filings:
18-
description: "Cached filings from previous runs, as stringified JSON. Without this, duplicate issues may be filed."
19-
required: false
2014
cached_filings_file:
21-
description: "Path to a JSON file containing cached filings (alternative to 'cached_filings' for large datasets)"
15+
description: "Path to a JSON file containing cached filings from previous runs. Without this, duplicate issues may be filed."
2216
required: false
2317
screenshot_repository:
2418
description: "Repository (with owner) where screenshots are stored on the gh-cache branch. Defaults to the 'repository' input if not set. Required if issues are open in a different repo to construct proper screenshot URLs."
@@ -29,10 +23,8 @@ inputs:
2923
default: "false"
3024

3125
outputs:
32-
filings:
33-
description: "List of issues filed (and their associated finding(s)), as stringified JSON"
3426
filings_file:
35-
description: "Path to a JSON file containing filings (use for large datasets to avoid output size limits)"
27+
description: "Path to a JSON file containing the list of issues filed (and their associated finding(s))"
3628

3729
runs:
3830
using: "node24"

.github/actions/file/src/index.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,20 @@ const OctokitWithThrottling = Octokit.plugin(throttling)
1818

1919
export default async function () {
2020
core.info("Started 'file' action")
21-
const findingsFile = core.getInput('findings_file', {required: false})
22-
const findings: Finding[] = findingsFile
23-
? JSON.parse(fs.readFileSync(findingsFile, 'utf8'))
24-
: JSON.parse(core.getInput('findings', {required: !findingsFile}))
21+
const findingsFile = core.getInput('findings_file', {required: true})
22+
const findings: Finding[] = JSON.parse(fs.readFileSync(findingsFile, 'utf8'))
2523
const repoWithOwner = core.getInput('repository', {required: true})
2624
const token = core.getInput('token', {required: true})
2725
const screenshotRepo = core.getInput('screenshot_repository', {required: false}) || repoWithOwner
2826
const cachedFilingsFile = core.getInput('cached_filings_file', {required: false})
2927
const cachedFilings: (ResolvedFiling | RepeatedFiling)[] = cachedFilingsFile
3028
? JSON.parse(fs.readFileSync(cachedFilingsFile, 'utf8'))
31-
: JSON.parse(core.getInput('cached_filings', {required: false}) || '[]')
29+
: []
3230
const shouldOpenGroupedIssues = core.getBooleanInput('open_grouped_issues')
33-
core.debug(`Input: 'findings: ${JSON.stringify(findings)}'`)
31+
core.debug(`Input: 'findings_file: ${findingsFile}'`)
3432
core.debug(`Input: 'repository: ${repoWithOwner}'`)
3533
core.debug(`Input: 'screenshot_repository: ${screenshotRepo}'`)
36-
core.debug(`Input: 'cached_filings: ${JSON.stringify(cachedFilings)}'`)
34+
core.debug(`Input: 'cached_filings_file: ${cachedFilingsFile}'`)
3735
core.debug(`Input: 'open_grouped_issues: ${shouldOpenGroupedIssues}'`)
3836

3937
const octokit = new OctokitWithThrottling({
@@ -137,12 +135,10 @@ export default async function () {
137135
}
138136
}
139137

140-
core.setOutput('filings', JSON.stringify(filings))
141-
142138
const filingsPath = path.join(process.env.RUNNER_TEMP || '/tmp', 'filings.json')
143139
fs.writeFileSync(filingsPath, JSON.stringify(filings))
144140
core.setOutput('filings_file', filingsPath)
145141

146-
core.debug(`Output: 'filings: ${JSON.stringify(filings)}'`)
142+
core.debug(`Output: 'filings_file: ${filingsPath}'`)
147143
core.info("Finished 'file' action")
148144
}

.github/actions/find/action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ inputs:
2424
required: false
2525

2626
outputs:
27-
findings:
28-
description: 'List of potential accessibility gaps, as stringified JSON'
2927
findings_file:
30-
description: 'Path to a JSON file containing findings (use for large datasets to avoid output size limits)'
28+
description: 'Path to a JSON file containing the list of potential accessibility gaps'
3129

3230
runs:
3331
using: 'node24'

.github/actions/find/src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@ export default async function () {
4646
core.info(`Found ${findingsForUrl.length} findings for ${url}`)
4747
}
4848

49-
core.setOutput('findings', JSON.stringify(findings))
50-
5149
const findingsPath = path.join(process.env.RUNNER_TEMP || '/tmp', 'findings.json')
5250
fs.writeFileSync(findingsPath, JSON.stringify(findings))
5351
core.setOutput('findings_file', findingsPath)
5452

55-
core.debug(`Output: 'findings: ${JSON.stringify(findings)}'`)
53+
core.debug(`Output: 'findings_file: ${findingsPath}'`)
5654
core.info(`Found ${findings.length} findings in total`)
5755
core.info("Finished 'find' action")
5856
}

.github/actions/fix/action.yml

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

44
inputs:
5-
issues:
6-
description: "List of issues to attempt to fix, as stringified JSON"
7-
required: false
85
issues_file:
9-
description: "Path to a JSON file containing issues (alternative to 'issues' for large datasets)"
10-
required: false
6+
description: "Path to a JSON file containing the list of issues to attempt to fix"
7+
required: true
118
repository:
129
description: "Repository (with owner) containing issues"
1310
required: true
@@ -16,10 +13,8 @@ inputs:
1613
required: true
1714

1815
outputs:
19-
fixings:
20-
description: "List of pull requests filed (and their associated issues), as stringified JSON"
2116
fixings_file:
22-
description: "Path to a JSON file containing fixings (use for large datasets to avoid output size limits)"
17+
description: "Path to a JSON file containing the list of pull requests filed (and their associated issues)"
2318

2419
runs:
2520
using: "node24"

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ const OctokitWithThrottling = Octokit.plugin(throttling)
1313

1414
export default async function () {
1515
core.info("Started 'fix' action")
16-
const issuesFile = core.getInput('issues_file', {required: false})
17-
const issues: IssueInput[] = issuesFile
18-
? JSON.parse(fs.readFileSync(issuesFile, 'utf8'))
19-
: JSON.parse(core.getInput('issues', {required: !issuesFile}) || '[]')
16+
const issuesFile = core.getInput('issues_file', {required: true})
17+
const issues: IssueInput[] = JSON.parse(fs.readFileSync(issuesFile, 'utf8'))
2018
const repoWithOwner = core.getInput('repository', {required: true})
2119
const token = core.getInput('token', {required: true})
22-
core.debug(`Input: 'issues: ${JSON.stringify(issues)}'`)
20+
core.debug(`Input: 'issues_file: ${issuesFile}'`)
2321
core.debug(`Input: 'repository: ${repoWithOwner}'`)
2422

2523
const octokit = new OctokitWithThrottling({
@@ -61,12 +59,10 @@ export default async function () {
6159
}
6260
}
6361

64-
core.setOutput('fixings', JSON.stringify(fixings))
65-
6662
const fixingsPath = path.join(process.env.RUNNER_TEMP || '/tmp', 'fixings.json')
6763
fs.writeFileSync(fixingsPath, JSON.stringify(fixings))
6864
core.setOutput('fixings_file', fixingsPath)
6965

70-
core.debug(`Output: 'fixings: ${JSON.stringify(fixings)}'`)
66+
core.debug(`Output: 'fixings_file: ${fixingsPath}'`)
7167
core.info("Finished 'fix' action")
7268
}

0 commit comments

Comments
 (0)