mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-01 02:45:22 -08:00
Add artifact input to action.yml + improve logging
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import * as core from '@actions/core'
|
||||
import * as github from '@actions/github'
|
||||
import {GitHub} from '@actions/github/lib/utils'
|
||||
|
||||
@@ -50,7 +51,17 @@ export class ArtifactProvider implements InputProvider {
|
||||
run_id: this.runId
|
||||
})
|
||||
|
||||
if (resp.data.artifacts.length === 0) {
|
||||
core.warning(`No artifacts found in run ${this.runId}`)
|
||||
return {}
|
||||
}
|
||||
|
||||
const artifacts = resp.data.artifacts.filter(a => this.artifactNameMatch(a.name))
|
||||
if (artifacts.length === 0) {
|
||||
core.warning(`No artifact matches ${this.artifact}`)
|
||||
return {}
|
||||
}
|
||||
|
||||
for (const art of artifacts) {
|
||||
await downloadArtifact(this.octokit, art.id, art.name)
|
||||
const reportName = this.getReportName(art.name)
|
||||
|
||||
@@ -68,7 +68,9 @@ export async function listFiles(octokit: InstanceType<typeof GitHub>, sha: strin
|
||||
commit_sha: sha,
|
||||
...github.context.repo
|
||||
})
|
||||
return await listGitTree(octokit, commit.data.tree.sha, '')
|
||||
const files = await listGitTree(octokit, commit.data.tree.sha, '')
|
||||
core.info(`Found ${files.length} files tracked by GitHub in commit ${sha}`)
|
||||
return files
|
||||
}
|
||||
|
||||
async function listGitTree(octokit: InstanceType<typeof GitHub>, sha: string, path: string): Promise<string[]> {
|
||||
|
||||
Reference in New Issue
Block a user