Skip to content

Commit

Permalink
dog food
Browse files Browse the repository at this point in the history
  • Loading branch information
exoego committed May 6, 2024
1 parent f476a2a commit d28f2fa
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 19 deletions.
7 changes: 7 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ runs:
name: bundle
path: ${{ inputs.analyze_directory }}/bundle_analysis.json

- name: Upload images
uses: actions/upload-artifact@v4
if: success() && github.event.number
with:
name: bundle
path: ${{ inputs.analyze_directory }}/images/

- name: Find Comment
uses: peter-evans/find-comment@v3
if: success() && github.event.number
Expand Down
23 changes: 13 additions & 10 deletions dist/index.mjs

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions src/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,25 @@ This analysis was generated by [esbuild-bundle-analyzer](https://github.com/exoe
};
myChart.setOption({ series: [option] });

fs.writeFileSync(
path.join(
process.cwd(),
input.analyzerDirectory,
`${metafileRelPath}/${outfile}.svg`.replaceAll(/[/>]/g, "_"),
),
myChart.renderToSVGString().trim(),
const safeFileName = `${metafileRelPath}/${outfile}`.replaceAll(
/[/>]/g,
"_",
);

fs.mkdirSync(
path.join(process.cwd(), input.analyzerDirectory, "images"),
{
recursive: true,
},
);
fs.writeFileSync(
path.join(
process.cwd(),
input.analyzerDirectory,
`${metafileRelPath}/${outfile}.json`.replaceAll(/[/>]/g, "_"),
"images",
`${safeFileName}.svg`,
),
JSON.stringify(data, null, 2),
myChart.renderToSVGString().trim(),
);
}
}
Expand Down

0 comments on commit d28f2fa

Please sign in to comment.