We should not update the badge for pull-requests. One option would then be to run the tests again during push to main and only then update the badge. Maybe a better alternative would be to get the badge information during the push to main from the latest Pytest coverage comment of the PR using e.g. https://github.com/marketplace/actions/find-comment
If I understand it correctly then the pytest coverage badge in our readme is always updated whenever pytest runs: https://github.com/PTB-MR/mrpro/blob/6c1c8cce8c9aa2553db9ef153f64dd6cfe420fff/.github/workflows/pytest.yml#L87 and hence does not correspond to the current status in main.
We should not update the badge for pull-requests. One option would then be to run the tests again during push to main and only then update the badge. Maybe a better alternative would be to get the badge information during the push to main from the latest Pytest coverage comment of the PR using e.g. https://github.com/marketplace/actions/find-comment