From f34cfb91f4636c7897786ef31a3586a12e31bda0 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 17 Mar 2026 22:16:40 +0100 Subject: [PATCH] Add text groups (#721) --- action.yml | 16 ++++++++++++++++ cleanup-disk/action.yml | 9 ++++++--- scan-prs/action.yml | 7 ++++++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 8599b03..956efcc 100644 --- a/action.yml +++ b/action.yml @@ -112,6 +112,8 @@ runs: GITHUB_REPOSITORY: ${{ github.repository }} GITHUB_REF: ${{ github.ref }} run: | + echo "::group::Install Dependencies" + trap 'echo "::endgroup::"' EXIT # Install from git branch if testing in ultralytics/actions repo, otherwise from PyPI if [ "$GITHUB_REPOSITORY" = "ultralytics/actions" ]; then echo "Installing from git branch: $GITHUB_REF" @@ -168,6 +170,8 @@ runs: - name: Run Python if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && inputs.python == 'true' && (github.event.action == 'opened' || github.event.action == 'synchronize') run: | + echo "::group::Run Python" + trap 'echo "::endgroup::"' EXIT ruff check \ --fix \ --unsafe-fixes \ @@ -188,6 +192,8 @@ runs: - name: Run Biome if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && inputs.biome == 'true' && (github.event.action == 'opened' || github.event.action == 'synchronize') run: | + echo "::group::Run Biome" + trap 'echo "::endgroup::"' EXIT if [ -f "biome.json" ] || [ -f "biome.jsonc" ]; then npm install -g @biomejs/biome@latest npx biome --version @@ -202,6 +208,8 @@ runs: - name: Run Prettier if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && (inputs.prettier == 'true' || inputs.markdown == 'true') && (github.event.action == 'opened' || github.event.action == 'synchronize') run: | + echo "::group::Run Prettier" + trap 'echo "::endgroup::"' EXIT npm install -g prettier@3.6.2 prettier-plugin-sh ultralytics-actions-update-markdown-code-blocks npx prettier --write --list-different --print-width 120 "**/*.{js,jsx,ts,tsx,css,less,scss,json,yml,yaml,html,vue,svelte}" '!**/*lock.{json,yaml,yml}' '!**/*.lock' '!**/model.json' '!**/*.min.js' '!**/*.min.css' @@ -221,6 +229,8 @@ runs: - name: Run Swift Formatter if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && inputs.swift == 'true' && (github.event.action == 'opened' || github.event.action == 'synchronize') run: | + echo "::group::Run Swift Formatter" + trap 'echo "::endgroup::"' EXIT brew install swift-format swift-format --in-place --recursive . shell: bash @@ -245,6 +255,8 @@ runs: - name: Run Codespell if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && inputs.spelling == 'true' && (github.event.action == 'opened' || github.event.action == 'synchronize') run: | + echo "::group::Run Codespell" + trap 'echo "::endgroup::"' EXIT codespell \ --builtin clear,rare,informal,en-GB_to_en-US \ --write-changes \ @@ -305,6 +317,8 @@ runs: - name: Bun Update if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && inputs.bun_update == 'true' && github.event.action == 'opened' run: | + echo "::group::Bun Update" + trap 'echo "::endgroup::"' EXIT if [ -f "bun.lock" ] || [ -f "bun.lockb" ]; then npm install -g bun bun update @@ -321,6 +335,8 @@ runs: GITHUB_USERNAME: ${{ inputs.github_username }} GITHUB_EMAIL: ${{ inputs.github_email }} run: | + echo "::group::Commit and Push Changes" + trap 'echo "::endgroup::"' EXIT COMMIT_MSG="Auto-format by https://ultralytics.com/actions" # Check if last two commits were both auto-format to prevent recursive loops LAST_TWO=$(git log -2 --pretty=format:'%s' 2>/dev/null || echo "") diff --git a/cleanup-disk/action.yml b/cleanup-disk/action.yml index 4c58e3d..1102e67 100644 --- a/cleanup-disk/action.yml +++ b/cleanup-disk/action.yml @@ -9,17 +9,20 @@ runs: - name: Cleanup disk space shell: bash run: | - echo "Free space before deletion:" + echo "::group::Disk Space Before Cleanup" df -h / + echo "::endgroup::" + echo "::group::Remove Tool Cache and Swap" # Remove tool cache to free up ~15GB of space per https://github.com/ultralytics/ultralytics/pull/15848 rm -rf /opt/hostedtoolcache || true - # Remove swap space to free up ~4GB if [ -f /swapfile ]; then sudo swapoff -a sudo rm -f /swapfile fi + echo "::endgroup::" - echo "Free space after deletion:" + echo "::group::Disk Space After Cleanup" df -h / + echo "::endgroup::" diff --git a/scan-prs/action.yml b/scan-prs/action.yml index c189e3a..24db7bf 100644 --- a/scan-prs/action.yml +++ b/scan-prs/action.yml @@ -32,6 +32,8 @@ runs: GITHUB_REPOSITORY: ${{ github.repository }} GITHUB_SHA: ${{ github.sha }} run: | + echo "::group::Install ultralytics-actions" + trap 'echo "::endgroup::"' EXIT # Install from git commit if testing in ultralytics/actions repo, otherwise from main if [ "$GITHUB_REPOSITORY" = "ultralytics/actions" ]; then echo "Installing from commit: $GITHUB_SHA" @@ -52,5 +54,8 @@ runs: ORG: ${{ inputs.org }} VISIBILITY: ${{ inputs.visibility }} REPO_VISIBILITY: ${{ github.event.repository.visibility }} - run: python -m actions.scan_prs + run: | + echo "::group::Scan PRs" + trap 'echo "::endgroup::"' EXIT + python -m actions.scan_prs shell: bash