Since some action depend on the branch / tag you are on this is not always possible.
You don't want to experiment too much on main because it dirties your commit history with 20 "Fix typo"-esque commits.
Or, if you try to emulate the main branch with a fake main branch (so you can squash it later), you're still going to have some test commits when do the find-replace back to main.
Neither are great.
It gets painful if there are things you've only got on the main repo (e.g. custom runners, credentials, etc.) though.