Make format workflow compatible with multiple base branches
Make format workflow compatible with multiple base branches

This allows it to work on pull requests to any branch, which is helpful as we're moving to a multi-branch strategy.

Also stops the workflow from running on every push. This isn't currently useful on the `master` branch because it's just comparing it to itself, and it's mostly noise because it means the action runs 3 times on every commit. We should probably make a separate action if we want to support this.

Closes https://github.com/google/iree/pull/2271

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/iree/pull/2271 from GMNGeoffrey:portable-format-action 4a115ad5636aa0b921adddcbe75cd032aefa5554
PiperOrigin-RevId: 317688327

google/iree,google/iree,iree-org/iree,iree-org/iree,google/iree,iree-org/iree,google/iree,iree-org/iree,iree-org/iree,google/iree,google/iree,iree-org/iree,google/iree,iree-org/iree