Don't use such actions. Or fork them and commit add the lockfile yourself, if you're cool with the implied maintenance.
This is a long solved problem in every other ecosystem. This particular implementation isn't great but it has the right idea.
Depending on the action you use, this is no small task. You might as well just switch to something else altogether.