Skip to main content
Version: 2.x

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 as auto-merge.yml): a push made with GITHUB_TOKEN does not trigger CI, and GITHUB_TOKEN cannot 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. Add APP_ID and APP_PRIVATE_KEY under 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-ci is bumped. If you rely on this, remove the github-actions ecosystem from ciDependabotConfig.
  • Set ciEnableRegenerateWorkflows := false to opt out; the plugin then deletes only a regenerate-workflows.yml carrying its "autogenerated" header.

ZIO Chat

Hello! ๐Ÿ˜Š I'm your ZIO Chat Bot, designed to be your go-to resource for all things ZIO! Whether you're new to this powerful functional effect system or a seasoned pro, I'm here to assist you. ZIO empowers you to build concurrent and resilient applications in Scala, offering referential transparency, composable data types, type-safety, and more. So, go ahead and ask me anything about ZIO โ€“ I'm here to provide the answers you need! ๐Ÿค–