diff --git a/.github/workflows/visual-regression-diff-finish.yml b/.github/workflows/visual-regression-diff-finish.yml index 876d004190..a8a57576f6 100644 --- a/.github/workflows/visual-regression-diff-finish.yml +++ b/.github/workflows/visual-regression-diff-finish.yml @@ -90,7 +90,8 @@ jobs: ALI_OSS_AK_SECRET: ${{ secrets.ALI_OSS_AK_SECRET }} ALI_OSS_BUCKET: ${{ secrets.ALI_OSS_BUCKET }} run: | - tar -xzvf visualRegressionReport.tar.gz + mkdir ./visualRegressionReport + tar -xzvf visualRegressionReport.tar.gz -C ./visualRegressionReport echo "✅ Uncompress Finished" rm package.json @@ -114,7 +115,7 @@ jobs: ${{ steps.report.outputs.content }} body-include: '' - number: ${{ steps.pr.outputs.id }} + number: ${{ steps.report.outputs.id }} - name: failed comment if: ${{ fromJSON(needs.upstream-workflow-summary.outputs.build-failure) || steps.report.outcome == 'failure' || failure() }} @@ -126,4 +127,4 @@ jobs: 😔 📉 📊 ❌ 🚫 body-include: '' - number: ${{ steps.pr.outputs.id }} + number: ${{ steps.report.outputs.id }} diff --git a/scripts/visual-regression.ts b/scripts/visual-regression.ts index 94d523b097..e0660f0987 100644 --- a/scripts/visual-regression.ts +++ b/scripts/visual-regression.ts @@ -91,6 +91,7 @@ async function downloadBaseSnapshots(ref: string, targetDir: string) { await downloadFile(imageSnapshotsUrl, targzPath); // untar return tar.x({ + // remove top-level dir strip: 1, C: targetDir, file: targzPath, @@ -167,7 +168,7 @@ async function boot() { await fse.ensureDir(baseImgReportDir); await fse.ensureDir(currentImgReportDir); - console.log(chalk.blue('⛳ Checking image snapshots with branch `master`')); + console.log(chalk.blue('⛳ Checking image snapshots with branch %s'), targetBranch); console.log('\n'); const baseImgFileList = readPngs(baseImgSourceDir); @@ -238,6 +239,7 @@ async function boot() { await tar.c( { gzip: true, + // ignore top-level dir(e.g. visualRegressionReport) and zip all files in it cwd: reportDir, file: `${path.basename(reportDir)}.tar.gz`, },