Ultralytics Actions for GitHub automation and PR management.
Project description
🚀 Ultralytics Actions
Welcome to Ultralytics Actions - a collection of GitHub Actions for automating code quality, PR management, and CI/CD workflows across Ultralytics projects.
📦 Repository Contents
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
Ultralytics Actions (Main Action)
AI-powered formatting, labeling, and PR summaries for Python, Swift, and Markdown files.
📄 Features
- Python Code: Formatted using Ruff, an extremely fast Python linter and formatter
- Python Docstrings: Google-style formatting enforced with Ultralytics Python docstring formatter (optional)
- JavaScript/TypeScript: Formatted with Biome, an extremely fast formatter for JS, TS, JSX, TSX, and JSON (optional, auto-detected via
biome.json) - 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 AI
- 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 AI
🤖 Supported AI Providers
Choose between OpenAI or Anthropic for AI-powered features:
| Provider | Default Model | API Key |
|---|---|---|
| OpenAI | gpt-5.3-codex |
openai_api_key |
| Anthropic | claude-sonnet-4-6 |
anthropic_api_key |
The model is auto-detected based on which API key you provide. Override with the model input, or use review_model to override PR review only.
🛠️ How It Works
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 AI
🔧 Setup
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)
biome: true # Format JS/TS with Biome (auto-detected via biome.json)
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
# AI API keys - provide OpenAI OR Anthropic (model auto-detected from key)
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
# anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
# model: claude-haiku-4-5-20251001 # Optional: override default model
# review_model: claude-opus-4-5-20251101 # Optional: override PR review model
brave_api_key: ${{ secrets.BRAVE_API_KEY }} # Used for broken link resolution
Standalone Actions
Reusable composite actions for common CI/CD tasks. Each can be used independently in your workflows.
1. Retry Action
Retry failed commands with exponential backoff.
- uses: ultralytics/actions/retry@main
with:
command: npm install
max_attempts: 3
timeout_minutes: 5
2. Cleanup Disk Action
Free up disk space on GitHub runners by removing unnecessary packages and files.
- uses: ultralytics/actions/cleanup-disk@main
3. Scan PRs Action
List 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-separated
Python Package
Install ultralytics-actions for programmatic access to action utilities.
pip install ultralytics-actions
Available 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
💡 Contribute
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!
📄 License
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.
📫 Contact
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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ultralytics_actions-0.2.13.tar.gz.
File metadata
- Download URL: ultralytics_actions-0.2.13.tar.gz
- Upload date:
- Size: 81.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d08f3f9e2d271ccc366862dca8ab296fff167c327ede76f5882637adf6d7987
|
|
| MD5 |
6052078178c33848eac40f6eeda5b05c
|
|
| BLAKE2b-256 |
1a02900ec90141b704e7ae273699f5b12c8fd8a412c1be043c65b7a52a00ae24
|
Provenance
The following attestation bundles were made for ultralytics_actions-0.2.13.tar.gz:
Publisher:
publish.yml on ultralytics/actions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ultralytics_actions-0.2.13.tar.gz -
Subject digest:
8d08f3f9e2d271ccc366862dca8ab296fff167c327ede76f5882637adf6d7987 - Sigstore transparency entry: 998517403
- Sigstore integration time:
-
Permalink:
ultralytics/actions@62bea036a2810dd9f88f26f21ca542ecdf47578b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ultralytics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@62bea036a2810dd9f88f26f21ca542ecdf47578b -
Trigger Event:
push
-
Statement type:
File details
Details for the file ultralytics_actions-0.2.13-py3-none-any.whl.
File metadata
- Download URL: ultralytics_actions-0.2.13-py3-none-any.whl
- Upload date:
- Size: 74.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3261fa85bcaf3296c7f38e4e0477e578ed7c1cae45b41932e128336ec0a512e3
|
|
| MD5 |
2589742a6b6478fd4fc1f936f2ee745a
|
|
| BLAKE2b-256 |
82fd332b53904fffd27da4166213736ad64f45a07e086c2bcbc72ca91a23466f
|
Provenance
The following attestation bundles were made for ultralytics_actions-0.2.13-py3-none-any.whl:
Publisher:
publish.yml on ultralytics/actions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ultralytics_actions-0.2.13-py3-none-any.whl -
Subject digest:
3261fa85bcaf3296c7f38e4e0477e578ed7c1cae45b41932e128336ec0a512e3 - Sigstore transparency entry: 998517489
- Sigstore integration time:
-
Permalink:
ultralytics/actions@62bea036a2810dd9f88f26f21ca542ecdf47578b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ultralytics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@62bea036a2810dd9f88f26f21ca542ecdf47578b -
Trigger Event:
push
-
Statement type: