Skip to content

Commit 96b6c96

Browse files
committed
add fix for artifact debug
1 parent 472c5f1 commit 96b6c96

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

browserstack-report-action/dist/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41924,15 +41924,15 @@ class ArtifactManager {
4192441924

4192541925
try {
4192641926
// Create artifacts directory
41927-
const artifactDir = path.join(process.env.GITHUB_WORKSPACE || '.', 'browserstack-artifacts');
41928-
fs.mkdirSync(artifactDir, { recursive: true });
41927+
const artifactDir = path.join(process.cwd(), 'browserstack-artifacts');
41928+
fs.mkdirSync("browserstack-artifacts", { recursive: true });
4192941929

4193041930
// Create HTML file
4193141931
const fileName = `report.html`;
4193241932
const filePath = path.join(artifactDir, fileName);
4193341933

4193441934
// Write content
41935-
fs.writeFileSync(filePath, report);
41935+
fs.writeFileSync(`browserstack-artifacts/${fileName}`, report);
4193641936
const fileStat = fs.statSync(filePath);
4193741937
core.exportVariable('BROWSERSTACK_REPORT_PATH', filePath);
4193841938
core.setOutput('fileStat', fileStat);
@@ -41959,12 +41959,12 @@ class ArtifactManager {
4195941959
return `File saved locally at: ${filePath}`;
4196041960
}
4196141961
const artifactName = `browserstack`;
41962-
const cwdPath = path.join(process.cwd(), 'browserstack-artifacts/reports.html');
41963-
fs.copyFileSync(filePath, cwdPath);
41964-
core.info(`Copied report to ${cwdPath}`);
41962+
// const cwdPath = path.join(process.cwd(), 'browserstack-artifacts/reports.html');
41963+
// fs.copyFileSync(filePath, cwdPath);
41964+
// core.info(`Copied report to ${cwdPath}`);
4196541965
const uploadResult = await artifactClient.uploadArtifact(
4196641966
artifactName,
41967-
['reports.html'],
41967+
['report.html'],
4196841968
process.cwd()+"/browserstack-artifacts",
4196941969
{ continueOnError: true }
4197041970
);

browserstack-report-action/src/utils/ArtifactManager.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ class ArtifactManager {
1414

1515
try {
1616
// Create artifacts directory
17-
const artifactDir = path.join(process.env.GITHUB_WORKSPACE || '.', 'browserstack-artifacts');
18-
fs.mkdirSync(artifactDir, { recursive: true });
17+
const artifactDir = path.join(process.cwd(), 'browserstack-artifacts');
18+
fs.mkdirSync("browserstack-artifacts", { recursive: true });
1919

2020
// Create HTML file
2121
const fileName = `report.html`;
2222
const filePath = path.join(artifactDir, fileName);
2323

2424
// Write content
25-
fs.writeFileSync(filePath, report);
25+
fs.writeFileSync(`browserstack-artifacts/${fileName}`, report);
2626
const fileStat = fs.statSync(filePath);
2727
core.exportVariable('BROWSERSTACK_REPORT_PATH', filePath);
2828
core.setOutput('fileStat', fileStat);
@@ -49,12 +49,12 @@ class ArtifactManager {
4949
return `File saved locally at: ${filePath}`;
5050
}
5151
const artifactName = `browserstack`;
52-
const cwdPath = path.join(process.cwd(), 'browserstack-artifacts/reports.html');
53-
fs.copyFileSync(filePath, cwdPath);
54-
core.info(`Copied report to ${cwdPath}`);
52+
// const cwdPath = path.join(process.cwd(), 'browserstack-artifacts/reports.html');
53+
// fs.copyFileSync(filePath, cwdPath);
54+
// core.info(`Copied report to ${cwdPath}`);
5555
const uploadResult = await artifactClient.uploadArtifact(
5656
artifactName,
57-
['reports.html'],
57+
['report.html'],
5858
process.cwd()+"/browserstack-artifacts",
5959
{ continueOnError: true }
6060
);

0 commit comments

Comments
 (0)