I once mentioned the problem of duplication in GitHub Actions workflows (YAML doesn't let us do much about it, maybe apart from extracting simple stuff to env vars).
Well, I decided to tackle it with a Kotlin DSL which is now published to Maven Central, and I propose to adopt it in kotlin-python:
https://github.com/krzema12/kotlin-python/pull/106