Skip to content

Commit 5e03f3f

Browse files
authored
4.0.1 - Fix artifact download (#9)
Fix bug introduced in v4 when the @actions/artifact was updated to v2
1 parent 6213939 commit 5e03f3f

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

index.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const artifact = require('@actions/artifact')
1+
const { DefaultArtifactClient } = require('@actions/artifact')
22
const core = require('@actions/core')
33
const exec = require('@actions/exec')
44
const github = require('@actions/github')
@@ -410,20 +410,15 @@ async function execAsync(command, args = [], options = {}) {
410410
async function getCoverage() {
411411
core.debug(`getCoverage: Starting...`)
412412

413-
const artifactClient = artifact.create()
413+
const artifactClient = new DefaultArtifactClient()
414414
const artifactName = 'coverageArtifact'
415415
const path = '~/downloads'
416-
const options = {
417-
createArtifactFolder: true
418-
}
419416

420417
core.debug(`getCoverage: Downloading artifact...`)
421418

422-
const downloadResult = await artifactClient.downloadArtifact(
423-
artifactName,
424-
path,
425-
options
426-
)
419+
const downloadResult = await artifactClient.downloadArtifact(artifactName, {
420+
path
421+
})
427422

428423
core.debug(
429424
`getCoverage: downloadResult=${JSON.stringify(downloadResult, null, 2)}`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "diff-coverage",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"description": "Checks that the added and modified lines are covered by unit tests",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)