Regenerate Workflows on Bot PRs
A bot PR often changes something the generated files depend on: Scala Steward bumping zio-sbt-ci itself, or Dependabot bumping an action pin in a generated workflow. Either leaves ciCheckGithubWorkflow failing in the Lint job, so the PR is red and auto-merge.yml never merges it, with nobody to fix it.
ciEnableRegenerateWorkflows defaults to true, so ciGenerateGithubWorkflow also generates regenerate-workflows.yml. On every same-repository PR opened by one of ciDependencyUpdateBots, it checks out the PR branch, runs sbt ciGenerateGithubWorkflow, and, if anything under .github changed, commits and pushes the result to that branch. The push re-runs CI on the new commit and, since auto-merge.yml re-evaluates on every push, the PR then merges once CI is green.
Things to know:
- It pushes with the GitHub App token (
APP_ID/APP_PRIVATE_KEY, the same asauto-merge.yml): a push made withGITHUB_TOKENdoes not trigger CI, andGITHUB_TOKENcannot push changes to.github/workflows/**at all. The App needs the Workflows repository permission. - Workflows triggered by
dependabot[bot]read the Dependabot secrets store, not the repository's Actions secrets. AddAPP_IDandAPP_PRIVATE_KEYunder Settings โ Secrets and variables โ Dependabot. - Regeneration is driven by your build, so a Dependabot bump of an action pin in a generated workflow is regenerated back to the plugin's own pin and the PR ends up empty. The plugin owns those pins; they move when
zio-sbt-ciis bumped. If you rely on this, remove thegithub-actionsecosystem fromciDependabotConfig. - Set
ciEnableRegenerateWorkflows := falseto opt out; the plugin then deletes only aregenerate-workflows.ymlcarrying its "autogenerated" header.