Skip to content

Commit 7a3399e

Browse files
committed
Fix artifact files paths
1 parent fb38e3d commit 7a3399e

5 files changed

Lines changed: 10 additions & 7 deletions

File tree

__tests__/main.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
rm,
1212
writeFile
1313
} from 'node:fs/promises'
14-
import { join, resolve } from 'node:path'
14+
import { join } from 'node:path'
1515
import { simpleGit, type SimpleGit } from 'simple-git'
1616
import type { ActionInputs } from '../src/inputs'
1717
import { run } from '../src/main'
@@ -152,8 +152,11 @@ describe('code-pushup action', () => {
152152
Parameters<ArtifactClient['uploadArtifact']>
153153
>(
154154
'code-pushup-report',
155-
['report.json', 'report.md'],
156-
resolve(join(workDir, '.code-pushup')),
155+
expect.arrayContaining([
156+
expect.stringContaining('report.json'),
157+
expect.stringContaining('report.md')
158+
]),
159+
expect.stringContaining('.code-pushup'),
157160
{ retentionDays: 14 }
158161
)
159162

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/persist.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ export function persistedCliFiles({
3232
}): PersistedCliFiles {
3333
const rootDir = path.join(directory, PERSIST_OUTPUT_DIR)
3434
const filename = isDiff ? `${PERSIST_FILENAME}-diff` : PERSIST_FILENAME
35-
const files = PERSIST_FORMAT.map(format => `${filename}.${format}`)
3635
const filePaths = PERSIST_FORMAT.reduce(
3736
(acc, format) => ({
3837
...acc,
3938
[`${format}FilePath`]: path.join(rootDir, `${filename}.${format}`)
4039
}),
4140
{} as Omit<PersistedCliFiles, 'artifactData'>
4241
)
42+
const files = Object.values(filePaths)
4343

4444
return {
4545
...filePaths,

0 commit comments

Comments
 (0)