Warning
ubuntu-slim is currently in public preview and may change before general availability. Please review GitHub's official documentation for the latest updates and breaking changes.
GitHub Actions recently introduced the lightweight ubuntu-slim runner (1 vCPU / 5 GB RAM, max 15 min runtime) as a cost-efficient alternative to ubuntu-latest. However, manually identifying which workflows can safely migrate is tedious and error-prone:
- ❌ Jobs using Docker commands or containers cannot migrate
- ❌ Jobs using services: containers are incompatible
- ❌ Jobs exceeding 15 minutes will fail
- ❌ Container-based GitHub Actions are not supported
gh-slimify automates this entire process, analyzing your workflows and safely migrating eligible jobs with a single command.
Install as a GitHub CLI extension:
Important
All commands must be executed from the repository root directory (where .github/workflows/ is located).
Get help:
Scan all workflows in .github/workflows/ to find migration candidates:
Example Output:
The output shows:
- ✅ Safe to migrate: Jobs with no missing commands and known execution time
- ⚠️ Can migrate but requires attention: Jobs with missing commands or unknown execution time
- Warning reasons: Displayed in a single line for easy understanding
- Relative file paths: Clickable links that work in VS Code, iTerm2, and other terminal emulators
Automatically update eligible jobs to use ubuntu-slim. By default, only safe jobs (no missing commands and known execution time) are updated:
Example Output (default - safe jobs only):
To also update jobs with warnings (missing commands or unknown execution time), use the --force flag:
Example Output (with --force):
Scan only specific workflow files:
Skip fetching job durations from GitHub API. This is useful for:
- API rate limit management: Avoid hitting GitHub API rate limits when scanning many workflows
- Faster scans: Skip API calls for quicker results
- When API access is unavailable: Use when GitHub API is not accessible
Use the --verbose flag to enable debug output, which can help troubleshoot issues with API calls or workflow parsing:
Update jobs with warnings (missing commands or unknown execution time):
A job is eligible for migration to ubuntu-slim if all of the following conditions are met:
- ✅ Runs on ubuntu-latest
- ✅ Does not use Docker commands (docker build, docker run, docker compose, etc.)
- ✅ Does not use Docker-based GitHub Actions (e.g., docker/build-push-action, docker/login-action)
- ✅ Does not use services: containers (PostgreSQL, Redis, MySQL, etc.)
- ✅ Does not use container: syntax (jobs running inside Docker containers)
- ✅ Latest workflow run duration is under 15 minutes (checked via GitHub API)
- ⚠️ Jobs using commands that exist in ubuntu-latest but not in ubuntu-slim (e.g. nvm) will be flagged with warnings but are still eligible for migration. You may need to add setup steps to install these tools in ubuntu-slim.
Note
The missing command detection is not complete. It cannot detect commands installed via setup actions (e.g., actions/setup-go@v5). These actions typically install tools that may not be available in ubuntu-slim by default, so manual verification is recommended.
If any condition is violated, the job will not be migrated.
Jobs are classified into two categories:
- ✅ Safe to migrate: No missing commands and execution time is known
- ⚠️ Can migrate but requires attention: Has missing commands or execution time is unknown
Missing commands are tools that exist in ubuntu-latest but need to be installed in ubuntu-slim (e.g., nvm). These jobs can still be migrated, but you may need to add setup steps to install the required tools.
Result: ✅ Eligible — No Docker, services, or containers
Result: ❌ Not eligible — Uses Docker-based action
Result: ❌ Not eligible — Uses services: containers
Result: ❌ Not eligible — Uses container: syntax
- Parse Workflows: Scans .github/workflows/*.yml files and parses job definitions
- Check Criteria: Evaluates each job against migration criteria (Docker, services, containers)
- Detect Missing Commands: Identifies commands used in jobs that exist in ubuntu-latest but not in ubuntu-slim
- Fetch Durations: Retrieves latest job execution times from GitHub API (unless --skip-duration is used)
- Classify Jobs: Separates jobs into "safe" (no warnings) and "requires attention" (has warnings) categories
- Report Results: Displays eligible jobs grouped by status with:
- Visual indicators (✅ for safe, ⚠️ for warnings)
- Warning reasons in a single line
- Relative file paths with line numbers (clickable in most terminals)
- Execution durations
- Auto-Fix (optional): Updates runs-on: ubuntu-latest to runs-on: ubuntu-slim:
- By default: Only safe jobs are updated
- With --force: All eligible jobs (including those with warnings) are updated
MIT License
.png)


