compressed-size-action icon indicating copy to clipboard operation
compressed-size-action copied to clipboard

Allow running with multiple configurations

Open sarayourfriend opened this issue 3 years ago • 2 comments

Our application (https://github.com/WordPress/openverse-frontend) generates two distinct bundle groups during the build process, a "modern" and "universal" bundle (this is a concept we inherit by using Nuxt). We'd like to have separate compressed size checks for each of the two build types, however, when you try to run the compressed-size-check action twice in one PR, it overwrites the comment.

You can observe the issue in this PR: https://github.com/WordPress/openverse-frontend/pull/1378

If you check the edit history of the bot's comment, you can see that it overwrote itself.

Would y'all accept a PR to add an optional "key"/"id"/"comment-key" (names are hard) input that could be used to specify the comment to update?

Essentially my idea would be to update this conditional to additionally check for the new input in the body: https://github.com/preactjs/compressed-size-action/blob/master/src/index.js#L202-L205

For example, instead of just compressed-size-check being in the body, it could be compressed-size-check::${key} or something along those lines.

Thanks!

sarayourfriend avatar May 03 '22 14:05 sarayourfriend

A comment key configuration would be great! Your proposed implementation sounds right to me.

developit avatar Jun 06 '22 02:06 developit

Hi @developit, I'm going to take a try implementing this today.

sarayourfriend avatar Jun 16 '22 03:06 sarayourfriend