Welcome to Ultralytics Actions - a collection of GitHub Actions and Python tools for automating code quality, PR management, and CI/CD workflows across Ultralytics projects.
This repository provides three main components:
- Ultralytics Actions - Main GitHub Action for AI-powered code formatting, PR summaries, and auto-labeling
- Standalone Actions - Reusable composite actions for common CI/CD tasks
- Python Package -
ultralytics-actionspackage for programmatic use
AI-powered formatting, labeling, and PR summaries for Python, Swift, and Markdown files.
- Python Code: Formatted using Ruff, an extremely fast Python linter and formatter
- Python Docstrings: Google-style formatting enforced with Ultralytics Python docstring formatter (optional)
- Markdown Files: Styled with Prettier to ensure consistent documentation appearance
- Swift Code: Formatted with
swift-format(requiresmacos-latestrunner) - Spell Check: Common misspellings caught using codespell
- Broken Links Check: Broken links identified using Lychee
- PR Summary: Concise Pull Request summaries generated using OpenAI GPT-5
- PR Review: AI-powered code reviews identify critical bugs, security issues, and quality concerns with suggested fixes
- Auto-labeling: Applies relevant labels to issues and PRs via OpenAI GPT-5
Triggers on GitHub events to streamline workflows:
- Push Events: Automatically formats code when changes are pushed to
main - Pull Requests: Ensures formatting standards, generates summaries, provides AI reviews, and applies labels
- Issues: Automatically applies relevant labels using GPT-5
Create .github/workflows/ultralytics-actions.yml:
# Ultralytics π AGPL-3.0 License - https://ultralytics.com/license
# Ultralytics Actions https://github.com/ultralytics/actions
# This workflow formats code and documentation in PRs to Ultralytics standards
name: Ultralytics Actions
on:
issues:
types: [opened]
pull_request:
branches: [main]
types: [opened, closed, synchronize, review_requested]
permissions:
contents: write # Modify code in PRs
pull-requests: write # Add comments and labels to PRs
issues: write # Add comments and labels to issues
jobs:
actions:
runs-on: ubuntu-latest
steps:
- name: Run Ultralytics Actions
uses: ultralytics/actions@main
with:
token: ${{ secrets.GITHUB_TOKEN }} # Auto-generated token
labels: true # Auto-label issues/PRs using AI
python: true # Format Python with Ruff
python_docstrings: false # Format Python docstrings (default: false)
prettier: true # Format YAML, JSON, Markdown, CSS
swift: false # Format Swift (requires macos-latest)
dart: false # Format Dart/Flutter
spelling: true # Check spelling with codespell
links: true # Check broken links with Lychee
summary: true # Generate AI-powered PR summaries
openai_api_key: ${{ secrets.OPENAI_API_KEY }} # Powers PR summaries, labels and reviews
brave_api_key: ${{ secrets.BRAVE_API_KEY }} # Used for broken link resolutionReusable composite actions for common CI/CD tasks. Each can be used independently in your workflows.
Retry failed commands with exponential backoff.
- uses: ultralytics/actions/retry@main
with:
command: npm install
max_attempts: 3
timeout_minutes: 5Free up disk space on GitHub runners by removing unnecessary packages and files.
- uses: ultralytics/actions/cleanup-disk@mainList open PRs across an organization and auto-merge eligible Dependabot PRs.
- uses: ultralytics/actions/scan-prs@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
org: ultralytics # Optional: defaults to ultralytics
visibility: private,internal # Optional: public, private, internal, all, or comma-separatedInstall ultralytics-actions for programmatic access to action utilities.
pip install ultralytics-actionsAvailable Modules:
actions.review_pr- AI-powered PR reviewactions.summarize_pr- Generate PR summariesactions.scan_prs- Scan and manage organization PRsactions.first_interaction- Welcome message for new contributors- And more in
actions/directory
Ultralytics thrives on community collaboration, and we deeply value your contributions! Please see our Contributing Guide for details on how you can get involved. We also encourage you to share your feedback through our Survey. A huge thank you π to all our contributors!
Ultralytics offers two licensing options:
- AGPL-3.0 License: An OSI-approved open-source license ideal for students, researchers, and enthusiasts who value open collaboration. See the LICENSE file for details.
- Enterprise License: Designed for commercial use, this license allows integrating Ultralytics software and AI models into commercial products without AGPL-3.0's open-source requirements. For enterprise solutions, contact Ultralytics Licensing.
For bug reports or feature suggestions related to Ultralytics Actions, please submit an issue via GitHub Issues. Join our Discord community for discussions and support!