GitHub Actions best practices

MSAL

Applies best practices to GitHub Actions workflows, including enabling dependency caching, using cached distributions, finding missing timeouts, removing unused inputs, preferring block-style job dependencies, and upgrading official actions to their latest versions.

org.openrewrite.github.GitHubActionsBestPractices
mod run . --recipe=org.openrewrite.github.GitHubActionsBestPractices

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Find jobs missing timeout
  2. Prefer block style for job dependencies
  3. Use actions/setup-java temurin distribution as they are cached in hosted runners
  4. Remove unused workflow dispatch inputs
  5. Setup Java dependency caching
  6. Upgrade official GitHub Actions to their latest versions