diff --git a/.github/scripts/frontend-js-size.mjs b/.github/scripts/frontend-js-size.mjs index e9c985b652..ce5fd10deb 100644 --- a/.github/scripts/frontend-js-size.mjs +++ b/.github/scripts/frontend-js-size.mjs @@ -530,19 +530,13 @@ function renderFrontendBundleReport(before, after) { return lines.join('\n'); } -function renderVisualizerArtifactLink() { - const artifactUrl = process.env.FRONTEND_BUNDLE_REPORT_ARTIFACT_URL; - const artifactName = process.env.FRONTEND_BUNDLE_REPORT_ARTIFACT_NAME || 'frontend-bundle-report'; - const htmlFile = process.env.FRONTEND_BUNDLE_REPORT_HTML_FILE || 'frontend-bundle-visualizer.html'; - return `> [Bundle visualizer HTML](${artifactUrl}) is included in the ${code(artifactName)} artifact as ${code(htmlFile)}.`; -} - const args = process.argv.slice(2); const [beforeDir, afterDir, beforeStatsFile, afterStatsFile, outFile] = args; const before = await collectReport(beforeDir); const after = await collectReport(afterDir); const beforeStats = JSON.parse(await fs.readFile(beforeStatsFile, 'utf8')); const afterStats = JSON.parse(await fs.readFile(afterStatsFile, 'utf8')); +const visualizerArtifactLink = `> [Bundle visualizer HTML](${process.env.FRONTEND_BUNDLE_REPORT_ARTIFACT_URL}) is included in the ${code('frontend-bundle-visualizer')} artifact as ${code('frontend-bundle-visualizer.html')}.`; const body = [ marker, @@ -555,7 +549,7 @@ const body = [ '', renderFrontendBundleReport(collectVisualizerReport(beforeStats), collectVisualizerReport(afterStats)), '', - renderVisualizerArtifactLink(), + visualizerArtifactLink, ].join('\n'); await fs.writeFile(outFile, body); diff --git a/.github/workflows/frontend-bundle-report.yml b/.github/workflows/frontend-bundle-report.yml index eb6c64e5f7..b249fa8a79 100644 --- a/.github/workflows/frontend-bundle-report.yml +++ b/.github/workflows/frontend-bundle-report.yml @@ -141,8 +141,6 @@ jobs: HEAD_SHA: ${{ github.event.pull_request.head.sha }} PR_NUMBER: ${{ github.event.pull_request.number }} FRONTEND_BUNDLE_REPORT_ARTIFACT_URL: ${{ steps.upload-bundle-visualizer.outputs.artifact-url }} - FRONTEND_BUNDLE_REPORT_ARTIFACT_NAME: frontend-bundle-visualizer - FRONTEND_BUNDLE_REPORT_HTML_FILE: frontend-bundle-visualizer.html run: | REPORT_DIR="$RUNNER_TEMP/frontend-bundle-report" node after/.github/scripts/frontend-js-size.mjs before after "$REPORT_DIR/before-stats.json" "$REPORT_DIR/after-stats.json" "$REPORT_DIR/frontend-js-size-report.md" @@ -157,7 +155,6 @@ jobs: REPORT_DIR="$RUNNER_TEMP/frontend-bundle-report" test -s "$REPORT_DIR/before-stats.json" test -s "$REPORT_DIR/after-stats.json" - test -s "$REPORT_DIR/frontend-bundle-visualizer.html" test -s "$REPORT_DIR/frontend-js-size-report.md" cat "$REPORT_DIR/frontend-js-size-report.md" >> "$GITHUB_STEP_SUMMARY"