Skip to content

Commit a54d83c

Browse files
authored
Merge pull request #566 from crazy-max/test-github-fix
test(github): generate random filename
2 parents 3cdc15c + cab9e29 commit a54d83c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

__tests__/github.test.itg.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {Build} from '../src/buildx/build';
2525
import {Exec} from '../src/exec';
2626
import {GitHub} from '../src/github';
2727
import {History} from '../src/buildx/history';
28+
import {Util} from '../src/util';
2829

2930
const fixturesDir = path.join(__dirname, '.fixtures');
3031
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'github-itg-'));
@@ -33,8 +34,10 @@ const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'tr
3334

3435
maybe('uploadArtifact', () => {
3536
it('uploads an artifact', async () => {
37+
const filename = path.join(tmpDir, `github-repo-${Util.generateRandomString()}.json`);
38+
fs.copyFileSync(path.join(fixturesDir, `github-repo.json`), filename);
3639
const res = await GitHub.uploadArtifact({
37-
filename: path.join(fixturesDir, 'github-repo.json'),
40+
filename: filename,
3841
mimeType: 'application/json',
3942
retentionDays: 1
4043
});

0 commit comments

Comments
 (0)