Closed Rolandisimo closed 2 years ago
I am having the same issue. The action first runs successfully on my feature branch but fails on the second run when master is checked out because it is missing the size-limit
dependency.
NOTE: I'm not the author, I just noticed this issue and https://github.com/andresz1/size-limit-action/issues/48 :-) And I think this should be closed.
The whole purpose of this is action is to compare sizes of bundles between pull request branch and base branch (additionally it fails if limits aren't satisfied, but that can be made easier outside of it). So it's expected for you to have size-limit installed and configured in base branch and pull request branch. Yes, you can't make a pull request where you install and configure it, because in that case base branch would not have it. Besides different places to look for configs to copy, size-limit
finds plugins by looking at package.json
, so to make it work in that case, this action would need to have logic for copying packages and configs here and there, so they're installed before building and checking limits. I think it just doesn't worth it.
Great explanation @faergeek! that's just right
The action runs correctly for my feature branch but then checks out to master and runs the action again which is not what I want (also master does not have
size-limit
as a dependency yet which makes the CLI run fail)How can I ensure it runs only for the current branch?
My size-limit config looks like:
the action logs: