I never want anyone on my team to ever have to waste a second of their life on stupid shit like:
- Formatting
- Lints (with automatic fixes)
Behold! I drag something like this, from project to project. It's time I scream about it.
n.b.
concurrencyto reduce conflictscancel-in-progressto prefer theHEAD- Put all your fixes in
scripts/fixbot; easy to run locally
The easy way is to treat your team like adults and allow force pushes; but, sadly, we both know that won't pass compliance.
The correct way is to create a Github Application. Eventually you'll do this because deploy keys are dangerous and storing secrets in Github Actions is negligent.
The fast way is to:
- Generate a SSH key for your
fixbot:
ssh-keygen -f fixbot_key -C yourname+fixbot@yourcompany.com - Add the public key (
fixbot_key.pub) as a Deploy Key with write access to your repository:
https://github.com/your-org/your-repository/settings/keys - Create a
fixbotenvironment:
https://github.com/your-org/your-repository/settings/environments- Deployment branches and tags: Protected branches only
- Environment secrets:
DEPLOY_SSH_KEY: add the private key (fixbot_key) here!
- Delete
fixbot_keyandfixbot_key.pub - Add Deploy Keys to the Bypass List for your repository's ruleset (you are using rulesets, right?):
https://github.com/your-org/your-repository/settings/rules
Friends of mine set this up to run on their PRs.
Combined with a squash and merge workflow, it keeps their main history tidy.
I don't.
Why?
- I rebase
- I don't want my branch to change underneath me
- My PR's are written to be easy to review; that means I generally aim for minimal diffs
Autoformatted code creates diffs that are larger than necessary. (TODO: examples)
You may say I'm a dreamer, but I'm not the only one: