For me this happened on a matrix job where I was migrating from npm to pnpm and the action was configured assuming both branches has the pnpm-lock.yaml file.
npm
pnpm
pnpm-lock.yaml
All I had to do to fix it was synchronize the branches.