Skip to content

Commit 9aeb564

Browse files
committed
cascading-runs: rename parameter to a less generic name
It is not just any old Check Run that we need here, it is a `tag-git` Check Run. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent e9e31db commit 9aeb564

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

GitForWindowsHelper/cascading-runs.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,30 @@ const getToken = (() => {
1111
return async (context, owner, repo) => tokens[[owner, repo]] || (tokens[[owner, repo]] = await get(context, owner, repo))
1212
})()
1313

14-
const triggerGitArtifactsRuns = async (context, checkRunOwner, checkRunRepo, checkRun) => {
15-
const commitSHA = checkRun.head_sha
16-
const conclusion = checkRun.conclusion
17-
const text = checkRun.output.text
14+
const triggerGitArtifactsRuns = async (context, checkRunOwner, checkRunRepo, tagGitCheckRun) => {
15+
const commitSHA = tagGitCheckRun.head_sha
16+
const conclusion = tagGitCheckRun.conclusion
17+
const text = tagGitCheckRun.output.text
1818

1919
if (conclusion !== 'success') {
20-
throw new Error(`tag-git run ${checkRun.id} completed with ${conclusion}: ${checkRun.html_url}`)
20+
throw new Error(`tag-git run ${tagGitCheckRun.id} completed with ${conclusion}: ${tagGitCheckRun.html_url}`)
2121
}
2222

2323
const match = text.match(/For details, see \[this run\]\(https:\/\/github.com\/([^/]+)\/([^/]+)\/actions\/runs\/(\d+)\)/)
24-
if (!match) throw new Error(`Unhandled 'text' attribute of tag-git run ${checkRun.id}: ${checkRun.url}`)
24+
if (!match) throw new Error(`Unhandled 'text' attribute of tag-git run ${tagGitCheckRun.id}: ${tagGitCheckRun.url}`)
2525
const owner = match[1]
2626
const repo = match[2]
2727
const workflowRunId = Number(match[3])
2828
if (owner !== 'git-for-windows' || repo !== 'git-for-windows-automation') {
29-
throw new Error(`Unexpected repository ${owner}/${repo} for tag-git run ${checkRun.id}: ${checkRun.url}`)
29+
throw new Error(`Unexpected repository ${owner}/${repo} for tag-git run ${tagGitCheckRun.id}: ${tagGitCheckRun.url}`)
3030
}
3131

32-
const gitVersionMatch = checkRun.output.summary.match(/^Tag Git (\S+) @([0-9a-f]+)$/)
32+
const gitVersionMatch = tagGitCheckRun.output.summary.match(/^Tag Git (\S+) @([0-9a-f]+)$/)
3333
if (!gitVersionMatch) {
34-
throw new Error(`Could not parse Git version from summary '${checkRun.output.summary}' of tag-git run ${checkRun.id}: ${checkRun.url}`)
34+
throw new Error(`Could not parse Git version from summary '${tagGitCheckRun.output.summary}' of tag-git run ${tagGitCheckRun.id}: ${tagGitCheckRun.url}`)
3535
}
3636
if (commitSHA !== gitVersionMatch[2]) {
37-
throw new Error(`Expected ${commitSHA} in summary '${checkRun.output.summary}' of tag-git run ${checkRun.id}: ${checkRun.url}`)
37+
throw new Error(`Expected ${commitSHA} in summary '${tagGitCheckRun.output.summary}' of tag-git run ${tagGitCheckRun.id}: ${tagGitCheckRun.url}`)
3838
}
3939
const gitVersion = gitVersionMatch[1]
4040

0 commit comments

Comments
 (0)