1
0
Fork 0
mirror of https://github.com/dorny/test-reporter.git synced 2026-05-07 02:57:36 +02:00

Refactor code for changes in @actions/github v9

This commit is contained in:
Jozef Izso 2026-03-02 15:44:41 +01:00
parent 419ef42f63
commit 66bccdca48
Failed to extract signature
3 changed files with 15 additions and 6 deletions

View file

@ -1,6 +1,6 @@
import * as core from '@actions/core'
import * as github from '@actions/github'
import {GitHub} from '@actions/github/lib/utils.js'
import {GitHub} from '@actions/github/lib/utils'
import Zip from 'adm-zip'
import picomatch from 'picomatch'
@ -8,6 +8,11 @@ import picomatch from 'picomatch'
import {FileContent, InputProvider, ReportInput} from './input-provider.js'
import {downloadArtifact, listFiles} from '../utils/github-utils.js'
type WorkflowRunArtifact = {
id: number
name: string
}
export class ArtifactProvider implements InputProvider {
private readonly artifactNameMatch: (name: string) => boolean
private readonly fileNameMatch: (name: string) => boolean
@ -50,10 +55,10 @@ export class ArtifactProvider implements InputProvider {
async load(): Promise<ReportInput> {
const result: ReportInput = {}
const allArtifacts = await this.octokit.paginate(this.octokit.rest.actions.listWorkflowRunArtifacts, {
const allArtifacts = (await this.octokit.paginate(this.octokit.rest.actions.listWorkflowRunArtifacts, {
...github.context.repo,
run_id: this.runId
})
})) as WorkflowRunArtifact[]
if (allArtifacts.length === 0) {
core.warning(`No artifacts found in run ${this.runId}`)