Skip to content

Releases: ultralytics/actions

v0.2.8 - New format Markdown string function (#663)

19 Nov 14:32
fd550b8

Choose a tag to compare

๐ŸŒŸ Summary

Ultralytics Actions v0.2.8 focuses on smarter, cleaner automation: better AI-powered PR reviews, richer GitHub issue templates, and powerful markdown/code formatting tools for both files and in-memory strings. โœจ


๐Ÿ“Š Key Changes

  • ๐Ÿงฉ New markdown string formatter (core of this release)

    • Added process_markdown_string(...) to format Python and Bash code blocks inside in-memory markdown strings, not just files.
    • Reuses existing formatting logic (process_markdown_file, format_code_with_ruff, format_bash_with_prettier, update_markdown_file) for consistent behavior.
    • Safely handles temp files via tempfile.TemporaryDirectory() so nothing is written permanently.
  • ๐Ÿค– Smarter, more focused AI PR reviews

    • Switched review generation to the gpt-5.1-codex model for better code understanding.
    • Introduced should_skip_file() and refined skip patterns to avoid generated/minified/irrelevant files.
    • Added safeguards:
      • Ignore non-file paths and files larger than 100 KB.
      • Limit file content to a 5,000-character snippet, with a clear ... (truncated) marker.
    • Added prompt controls:
      • Uses a conservative token budget estimate to stay under MAX_PROMPT_CHARS.
      • Caps inline review comments at MAX_REVIEW_COMMENTS = 8.
      • Sorts comments by severity, then file, then line number using SEVERITY_RANK.
    • Improves GitHub API usage for reviews and comments:
      • Proper pagination (?per_page=100) for reviews and comments.
      • Correct delete endpoint for inline comments (/pulls/comments/{id}).
      • More robust HTTP status handling: only treat unexpected status codes as hard errors.
    • Adds detailed debug logging (system and user prompts) specifically when running in ultralytics/actions for easier troubleshooting.
  • ๐Ÿงน Consistent Prettier formatting at 120 characters

    • Updated action.yml and update_markdown_code_blocks.py so Prettier runs with --print-width 120 for:
      • JS/TS, CSS, JSON, YAML, HTML, Vue, Svelte, etc.
      • Shell scripts via prettier-plugin-sh.
      • Markdown files (including docs, with existing --tab-width 4 preserved).
    • Ensures generated shell code blocks in markdown also use the 120-character width.
  • ๐Ÿงญ Cleaner URL handling & GitHub client refactor

    • Simplified clean_url() to more reliably strip quotes, trailing punctuation, .git@main, and git+, including nested cases.
    • Refactored GitHubClient to parse and store owner and repo_name once, then reuse them in:
      • is_org_member
      • get_label_ids (GraphQL)
      • block_user
      • get_pr_contributors
    • Improved HTTP request handling:
      • Separates โ€œstatus is expectedโ€ from โ€œstatus is successfulโ€.
      • Only raises errors when status is unexpected, not just because itโ€™s 4xx, making workflows more resilient.
  • ๐Ÿ“‹ New GitHub issue templates & support links

  • ๐Ÿ”ข Version bump

    • actions/__init__.py version updated from 0.2.7 to 0.2.8.

๐ŸŽฏ Purpose & Impact

  • ๐Ÿš€ Easier programmatic docs & content generation

    • process_markdown_string(...) lets you format markdown that lives purely in memory (e.g., generated docs, bot comments, PR descriptions) without touching the filesystem.
    • Ensures Python and Bash code blocks are consistently formatted whether they come from files or are dynamically generated.
  • ๐Ÿค– Higher-quality, more reliable PR reviews

    • Using gpt-5.1-codex should improve code understanding and the relevance of automated feedback.
    • Smarter file skipping, size limits, and content truncation keep the AI focused on meaningful changes and avoid wasting tokens on noise.
    • Comment capping, severity-based sorting, and concise-guidance produce fewer but higher-value review comments, making them easier for maintainers to act on.
    • More robust API handling reduces flaky failures and edge cases when dismissing old reviews or deleting previous comments.
  • ๐Ÿ“ Cleaner, more readable code and docs

    • A unified 120-character line width across JS/TS, shell scripts, and markdown reduces wrapping noise and makes diffs easier to review.
    • Consistent formatting across CI, local runs, and doc-generation tools leads to more predictable outputs and fewer formatting-only PR changes.
  • ๐Ÿงฑ Stronger infrastructure for automation

    • Refined URL cleaning avoids broken or malformed links in generated content and summaries.
    • Centralized repo owner/name handling simplifies future integrations with GitHub APIs and reduces subtle bugs.
    • Clearer error semantics (expected vs. unexpected statuses) help workflows fail less often while still surfacing true misconfigurations.
  • ๐Ÿ™‹ Better support and community interaction

    • Structured issue templates help users provide the right information the first time, making it faster to reproduce and fix problems.
    • Direct links to docs and community channels encourage self-help and discussion, reducing friction for both users and maintainers.

Overall, v0.2.8 makes Ultralytics Actions more developer-friendly, more robust in CI, and better suited for automated documentation and review workflows. ๐Ÿ’ผโœจ

What's Changed

Full Changelog: v0.2.7...v0.2.8

v0.2.7 - New `gpt-5.1-2025-11-13` model (#651)

13 Nov 23:26
79818f5

Choose a tag to compare

๐ŸŒŸ Summary

v0.2.7 standardizes all OpenAI model references to gpt-5.1-2025-11-13 for more consistent, higher-quality reviews and accurate cost tracking across the action โš™๏ธ๐Ÿค–

๐Ÿ“Š Key Changes

  • Default model updated to gpt-5.1-2025-11-13 in action inputs and utilities
    • action.yml: openai_model default โ†’ gpt-5.1-2025-11-13
    • actions/utils/openai_utils.py: OPENAI_MODEL default โ†’ gpt-5.1-2025-11-13
  • PR review generation now uses gpt-5.1-2025-11-13 by default (still notes gpt-5-codex as an alternative)
  • Cost map updated: added gpt-5.1-2025-11-13, removed gpt-5-2025-08-07 for accurate billing estimates
  • Version bump: 0.2.6 โ†’ 0.2.7

See PR: New gpt-5.1-2025-11-13 model (#651) by @glenn-jocher

๐ŸŽฏ Purpose & Impact

  • Better defaults out of the box ๐Ÿš€: Aligns reviews and tools on a single, newer model for improved reasoning and consistency.
  • Accurate cost tracking ๐Ÿ’ธ: MODEL_COSTS now reflects the new default, helping teams estimate usage reliably.
  • Non-breaking upgrade โœ…: Minor version bump indicates safe adoption with improved behavior.
  • Clear configuration paths ๐Ÿ”ง: Users can still override the model via action input or environment variable.

Example usage:

# Override in workflow if needed
- uses: ultralytics/[email protected]
  with:
    openai_model: gpt-5.1-2025-11-13

Or set environment variable:

export OPENAI_MODEL=gpt-5.1-2025-11-13

What's Changed

Full Changelog: v0.2.6...v0.2.7

v0.2.6 - Optimize citation removal in sanitize_ai_text (#650)

09 Nov 22:21
95942d5

Choose a tag to compare

๐ŸŒŸ Summary

Faster, cleaner PR review outputs: v0.2.6 optimizes AI text sanitization with a precompiled regex and standardizes its use across the workflow. โšก๐Ÿงผ

๐Ÿ“Š Key Changes

๐ŸŽฏ Purpose & Impact

  • Performance boost: Avoids recompiling regex on every call, improving speed in hot paths. ๐Ÿš€
  • Cleaner outputs: Removes leaked AI citation tokens (e.g., internal tool refs) for more readable PR reviews. ๐Ÿงฝ
  • Consistency: One shared sanitization utility used across actions reduces duplication and drift. ๐Ÿงฉ
  • Reliability: Better handling of empty inputs prevents unexpected crashes or noisy logs. ๐Ÿ›ก๏ธ
  • Maintainability: A single, precompiled pattern is easier to update and test. ๐Ÿ› ๏ธ

Quick usage example:

from actions.utils import sanitize_ai_text

text = "Please cite turn3search5 for details."
clean = sanitize_ai_text(text)  # -> "Please  for details."

What's Changed

Full Changelog: v0.2.5...v0.2.6

v0.2.5 - List skipped PR Review files (#648)

09 Nov 15:40
f9ca609

Choose a tag to compare

๐ŸŒŸ Summary

v0.2.5 sharpens PR review quality and speeds up CI by making skipped files explicit, skipping minified assets in formatting, hardening text sanitization, and aligning tooling to Python 3.9. ๐Ÿš€

๐Ÿ“Š Key Changes

๐ŸŽฏ Purpose & Impact

  • Greater PR review transparency and trust โœ…
    • Reviewers can see exactly which files were skipped (lock/minified/images, etc.), improving auditability and debugging.
  • Faster, cleaner CI and diffs ๐Ÿš€
    • Skipping minified files reduces processing time and avoids noisy or risky formatting changes.
  • More reliable automated comments ๐Ÿ›ก๏ธ
    • Fixed Unicode-related citation artifacts in AI-generated reviews for cleaner outputs.
  • Consistent tooling and environment ๐Ÿ”’
    • Standardizing on Python 3.9 simplifies linting, formatting, and CI behavior.
  • Better contributor experience ๐Ÿงญ
    • Clearer CLI docs, normalized docstring headers, and refactored utilities make contributions smoother.

Overall, v0.2.5 focuses on clarity, speed, and consistencyโ€”making reviews more informative and CI more efficient. ๐ŸŽ‰

What's Changed

Full Changelog: v0.2.4...v0.2.5

v0.2.4 - Enable new Ultralytics Google-style docstring formatter (#637)

02 Nov 19:23
44878d9

Choose a tag to compare

๐ŸŒŸ Summary

v0.2.4 turns on our new Googleโ€‘style Python docstring formatter by default, delivers faster and smarter docstring formatting, and makes AI PR reviews cleaner and more accurate. โœจโšก

๐Ÿ“Š Key Changes

  • New formatter enabled by default
  • Faster, safer, style-aware docstring formatting
    • Parallel processing for speed, smarter file discovery (skips venv/cache/build dirs), and robust wrapping of lists, code fences, tables, and preformatted blocks. Preserves non-Google styles (NumPy, reST, Epydoc) without touching them. See PR Parallelize docstring formatter (#635). โšก๐Ÿ›ก๏ธ
    • Cleaner list formatting by correctly joining continuation lines, reducing awkward breaks and noisy diffs. See PR Fix docstrings tail calculation (#636). ๐Ÿงน
    • New CLI flags: --check, --line-width=120, --start-newline for summary placement control. ๐Ÿงฐ
  • Cleaner AI PR reviews

๐ŸŽฏ Purpose & Impact

  • Consistent, readable docs by default
    • Turning the formatter on by default standardizes Python docstrings across projects, improving readability and maintainability. ๐Ÿ“š
  • Faster CI and fewer noisy diffs
    • Parallel processing and smarter wrapping reduce CI time and minimize unnecessary changes in PRs. ๐Ÿš€
  • Better contributor experience
    • PR reviews are cleaner, clearer, and precisely aligned to diffsโ€”reducing confusion and rework. โœ…
  • Flexible control when needed
    • Easily check or enforce formatting locally or in CI with simple flags, and disable via input if your repo requires it. ๐Ÿ”ง

Example usage:

  • Run a check locally (no changes):
    python actions/format_python_docstrings.py --check --line-width=120 .
  • Force summary to start on a new line:
    python actions/format_python_docstrings.py --start-newline path/to/file.py
  • Disable in your workflow if needed:
    with:
      python_docstrings: "false"

Thanks to @UltralyticsAssistant and @glenn-jocher for the improvements! ๐ŸŽ‰

What's Changed

Full Changelog: v0.2.3...v0.2.4

v0.2.3 - Add Python 3.14 support (#633)

31 Oct 18:56
41b7893

Choose a tag to compare

๐ŸŒŸ Summary

Python 3.14 support lands in CI and packaging metadata, ensuring Ultralytics Actions stay future-ready and compatible with the latest Python releases. ๐Ÿš€

๐Ÿ“Š Key Changes

  • โœ… CI updated to test on Python 3.14 (replacing 3.13) across ubuntu-latest and macos-latest runners; Windows remains excluded.
  • ๐Ÿท๏ธ Packaging metadata updated to include Python 3.14 in pyproject.toml classifiers.
  • ๐Ÿ”ข Version bump to 0.2.3.

Primary PR: Add Python 3.14 support by @glenn-jocher โ€” see the details in the PR: Add Python 3.14 support (PR #633).

๐ŸŽฏ Purpose & Impact

  • ๐Ÿš€ Early validation on Python 3.14 to catch ecosystem or dependency issues before they affect users.
  • ๐Ÿ”ง Improves reliability of Ultralytics Actions for teams upgrading to Python 3.14.
  • ๐Ÿ›ก๏ธ No breaking changes or behavior differencesโ€”safe update for all users.
  • ๐Ÿ—“๏ธ Reduces technical debt and keeps CI aligned with the latest Python versions.

Tip: If you want to pin your own workflows to Python 3.14, update your GitHub Actions matrix:

strategy:
  matrix:
    os: [ubuntu-latest, macos-latest]
    python-version: ["3.8", "3.14"]

What's Changed

Full Changelog: v0.2.2...v0.2.3

v0.2.2 - Update publish.yml

31 Oct 18:38
3a1c13a

Choose a tag to compare

๐ŸŒŸ Summary

Ultralytics Actions v0.2.2 is a focused patch release that introduces a fast, built-in Google-style Python docstring formatter, upgrades AI responses to structured JSON via a new API, and delivers cleaner, safer PR scanning and reviewing workflows โ€” topped off with a version bump. โœจ

๐Ÿ“Š Key Changes

  • ๐Ÿ“ฆ Version bump

  • ๐Ÿง  AI API upgrade with structured outputs

    • Replaced legacy get_completion with get_response across the codebase; adds JSON Schema-enforced outputs for reliability via Use JSON schema (PR #629).
    • PR Reviews now:
      • Use gpt-5-codex with low reasoning.
      • Return strict JSON Schema objects (comments + summary) โ€” no more fragile regex parsing.
      • Improve error logging with full API response bodies.
    • PR Open responses now return a strict JSON object for summary, labels, and first_comment.
  • โœ๏ธ New Google-style Python docstring formatter

    • Added an Ultralytics-built formatter with CLI ultralytics-actions-format-python-docstrings and Action input python_docstrings via New Google Python Docstring formatter (PR #630).
    • Replaces docformatter (dependency and config removed).
    • Integrated into:
      • Main formatting workflow (format.yml: python: true, python_docstrings: true/false).
      • Markdown code block formatter.
    • README updated to document optional docstring formatting.
    • Minimal workflow example:
      - uses: ultralytics/[email protected]
        with:
          python: true            # Ruff
          python_docstrings: true # Ultralytics formatter
          prettier: true
  • ๐Ÿ” Smarter, safer PR scanning

  • ๐Ÿง‘โ€โš–๏ธ Better PR reviews with more context

    • Action now also triggers on review_requested.
    • Optionally pulls safe full-file content (up to 10 files, within token budget) to reduce false positives via Add full-file context (PR #628).
    • Prompts clarify that web search is available.
  • ๐Ÿ› ๏ธ Workflow and tooling updates

    • publish.yml updated to use Python 3.13.
    • New Action input: python_docstrings (default: false) added to action.yml.
    • Tests updated to reflect API rename (get_response).
    • Docs updated to show comma-separated visibility for scan-prs and security note.

๐ŸŽฏ Purpose & Impact

  • Consistent docs at speed โšก
    • Enforces clean, Google-style docstrings with an Ultralytics-native tool; faster CI and simpler tooling (no external docformatter).
  • Reliable automation ๐Ÿค–
    • JSON Schema outputs eliminate brittle parsing; easier integration for bots, dashboards, and CI consumers.
  • Higher-quality reviews ๐Ÿงช
    • More timely and context-aware AI reviews reduce false positives and improve actionable feedback.
  • Safer org-wide scans ๐Ÿ”’
    • Security-aware visibility controls and robust status checks mean fewer surprises and clearer reporting.
  • Low risk, easy adoption โœ…
    • Mostly additive changes. If you previously relied on docformatter, switch to the new python_docstrings input and CLI.
    • Maintainers: verify workflows use GITHUB_TOKEN and toggle python_docstrings as desired.

Overall, v0.2.2 tightens reliability, consistency, and security across formatting, PR scanning, and AI-powered reviews โ€” with minimal disruption. ๐Ÿš€

What's Changed

Full Changelog: v0.2.1...v0.2.2

v0.2.1 - New scan PRs action (#623)

30 Oct 08:48
8be7f6b

Choose a tag to compare

๐ŸŒŸ Summary

v0.2.1 introduces a new Scan PRs composite action that centralizes org-wide PR visibility and safely auto-merges eligible Dependabot updates, plus smarter PR reviews (with web search), stronger linting, and more reliable CI tooling. ๐Ÿš€

๐Ÿ“Š Key Changes

๐ŸŽฏ Purpose & Impact

  • Centralize and automate PR ops across the org โš™๏ธ
    • Reduces manual triage by summarizing all open PRs with aging indicators
    • Safely auto-merges Dependabot PRs to keep workflows current with minimal human effort
  • Smarter, faster reviews with trusted context ๐Ÿง 
    • Web search (domain-filtered) helps reviewers validate information and references without leaving the PR
  • Higher code quality with fewer surprises โœ…
    • Stronger lint rules and improved spell checking surface issues earlier and reduce PR churn
  • More reliable CI with safer defaults ๐Ÿ”’
    • Better token fallback reduces auth-related failures
    • Loop-preventing auto-format guard avoids endless runs and noisy histories
  • Quicker dependency updates, smaller diffs โฑ๏ธ
    • Weekly Dependabot cadence improves security posture and keeps Actions up-to-date

Tip: To adopt the new PR scanning, add the reusable workflow step:

- uses: ultralytics/actions/scan-prs@main
  with:
    token: ${{ secrets._GITHUB_TOKEN }}

What's Changed

Full Changelog: v0.2.0...v0.2.1

v0.2.0 - Workflow dispatch from PR forks (#607)

23 Oct 23:30
dc9b4a2

Choose a tag to compare

๐ŸŒŸ Summary

Ultralytics Actions v0.2.0 focuses on reliable CI for forked PRs by creating temporary branches in the base repo, safer API handling, and clearer review/summary messagingโ€”plus multiple robustness and observability upgrades. ๐Ÿš€

๐Ÿ“Š Key Changes

  • CI for forked PRs (priority)
    • Creates a real temp branch in the base repo via git operations, then dispatches workflows from it; always cleans up. ๐Ÿ”€๐Ÿงน
    • Waits longer (60s) for workflows to appear and sanitizes error logs to avoid token leakage. โฑ๏ธ๐Ÿ”’
    • Refined CI comment formatting for clearer feedback.
  • Safer GitHub API handling
    • Treats 204 (No Content) as success for GET/POST to reduce false failures. โœ…
    • More informative error printing (includes details when present).
  • Version bump
    • __version__ โ†’ 0.2.0.
  • Install source change
    • Default install now pulls from GitHub main instead of PyPI to keep the action up to date. ๐Ÿ”„
  • Linting updates
    • Adds Pyflakes checks (F) to Ruff for catching undefined names and unused imports. ๐Ÿงน
    • Briefly enabled Ruffโ€™s native rules (RUF) then reverted to reduce noise.
  • OpenAI reliability and visibility
    • Smarter retries for 5xx and JSON parsing errors; improved timeout strategy (30s connect, 900s read). ๐Ÿ”โฑ๏ธ
    • Logs token usage, reasoning tokens, latency, and estimated cost per call. ๐Ÿ’ธ๐Ÿ“ˆ
    • Increased character limits (up to 3000) for prompts, summaries, and comments to reduce truncation. โœ๏ธ
  • Loop prevention improvement
    • Prevents recursive auto-format commits by checking the exact commit message instead of the author. ๐Ÿ”โœ…
  • Consistency and cleanup
    • Centralized branding credit, standardized headers, and modernized type hints.
    • Refactors/tests updated to match the new fork/temp-branch flow and utilities.

Links:

  • Current PR: Workflow dispatch from PR forks (#607)
  • Ultralytics Actions: Ultralytics Actions website

๐ŸŽฏ Purpose & Impact

  • More reliable CI for forks
    • Ensures forked PRs are testable by creating a temp branch in the base repo and dispatching from there. Fewer missed CI runs. ๐Ÿ”ง
  • Improved security and safety
    • Sanitizes git errors, avoids exposing secrets, and treats 204 status codes correctly to minimize false negatives. ๐Ÿ›ก๏ธ
  • Better developer experience
    • Clearer CI comments and PR review summaries; richer, less truncated AI feedback. โœจ
  • Greater observability and cost control
    • Transparent token, cost, and latency metrics enable better model selection and budgeting. ๐Ÿ’ก๐Ÿ’ฐ
  • Stricter code quality without breaking builds
    • Added Pyflakes checks catch common issues while keeping lint non-blocking. ๐Ÿงน๐Ÿšฆ
  • Faster access to fixes
    • Installing from GitHub main delivers the latest improvements sooner (with a small trade-off in reproducibility). โšก

Notes for users:

  • Requires a valid GITHUB_TOKEN with permission to push temp branches to the base repository for forked PR CI. ๐Ÿ”‘
  • Expect slightly longer waits before CI links appear due to the 60s startup buffer. โณ
  • Logs may be larger due to expanded summaries and usage reporting. ๐Ÿงพ

What's Changed

Full Changelog: v0.1.9...v0.2.0

v0.1.9 - Explicit diff line numbers (#584)

21 Oct 19:37
850e8ff

Choose a tag to compare

๐ŸŒŸ Summary

v0.1.9 makes PR reviews more accurate and reliable by adding explicit R/L line numbers to diffs, tightening comment validation, and improving CI workflows and OpenAI error handling. ๐ŸŽฏ๐Ÿงญ

๐Ÿ“Š Key Changes

  • Precision diffing and reviews (priority: latest PR)
    • Adds explicit R/L line-number prefixes to diffs for unambiguous inline comments. See PR #584: Explicit diff line numbers by @glenn-jocher. ๐Ÿงญ
    • parse_diff_files() now returns (file mapping, augmented diff) and the augmented diff is used in prompts and truncation logic.
    • Review prompts instruct the AI to reference R/L-prefixed numbers and to match the correct side field.
    • Example of augmented diff lines:
      R  123 +new code line
      L   45 -removed code line
             unchanged context
      
  • Safer, more predictable review logic
    • Skips comments with ambiguous or invalid line references; no auto-switching sides. See PR #583: Improve line number logic. ๐Ÿ›ก๏ธ
    • Always removes suggestions on LEFT (removed) lines to avoid GitHub rejections.
    • Cleans up noisy logs and minor whitespace in workflows.
  • Cleaner reviews and sturdier OpenAI retries
    • Trims review bodies before submission and makes server-error retries safer. See PR #582: Fix OpenAI retry logic. ๐Ÿ”๐Ÿงฝ
    • Ensures proper status code handling when HTTP errors lack a response object.
  • Easier org-wide visibility and Dependabot hygiene
    • Rewrites โ€œOpen PRsโ€ workflow in Python with age badges and clearer summaries; auto-merges safe Dependabot workflow PRs. See PR #581: Update Open PRs. ๐Ÿ“ฆ๐ŸŸข
    • Shows up to 30 PRs per repo and merges at most one safe workflow-only PR per repo.

๐ŸŽฏ Purpose & Impact

  • Fewer comment rejections and higher review accuracy
    • R/L-prefixed line numbers eliminate guessing and line-number drift in long diffs. โœ…
    • Stricter validation prevents misaligned comments and reduces GitHub API errors.
  • Better reviewer and contributor experience
    • Clear instructions and consistent formatting simplify parsing and reviewing. ๐Ÿงฉ
    • Cleaner logs and trimmed summaries make CI output easier to scan. ๐Ÿงน
  • More robust automation
    • Augmented diff-based truncation keeps context even in large changes. ๐Ÿ“
    • Safer retries reduce flakiness during model calls; improved logging aids debugging. ๐Ÿš€
  • Improved org maintenance
    • Python-based โ€œOpen PRsโ€ summary boosts visibility into active work with intuitive age signals. ๐Ÿ”
    • Safe, automated Dependabot merges keep workflows up to date with minimal risk. ๐Ÿค–

Tip: When programmatically creating review comments, ensure side matches the prefix:

  • Use side: "RIGHT" for R#### lines (new code).
  • Use side: "LEFT" for L#### lines (removed code).
  • Suggestions only on RIGHT lines.

What's Changed

Full Changelog: v0.1.8...v0.1.9