Use GNU tar on macOS if available by Cyberbeni · Pull Request #701 · actions/toolkit (original) (raw)
PRs for this is already open and it's focused on support more platforms.
Yeah, that PR looks pretty messy and incorrect and abandoned.
You neglected the fact that gnu-tar was not even installed on macOS runners at that time (but thankfully that request went through pretty smoothly), it is also included in the path as gtar by default (so checking the version of all tars in the path won't work) and checking for the output of version makes it way harder to intentionally override in case you have a problem with GNU tar and want to actually keep using BSD tar for caching for some reason and don't want to fork everything that uses caching in your workflow just to do that.
This pull request aims to fix exactly 1 problem (tar often resulting in malformed output on macOS) without making possibly breaking changes in other platforms/cases. I would prefer you not break caching on macOS when you only have a different problem with caching on Windows.