ultralytics-actions 0.1.9__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ultralytics-actions might be problematic. Click here for more details.
- {ultralytics_actions-0.1.9/ultralytics_actions.egg-info → ultralytics_actions-0.2.1}/PKG-INFO +114 -66
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/README.md +113 -65
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/actions/__init__.py +4 -1
- ultralytics_actions-0.2.1/actions/dispatch_actions.py +172 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/actions/first_interaction.py +5 -7
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/actions/review_pr.py +48 -35
- ultralytics_actions-0.2.1/actions/scan_prs.py +205 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/actions/summarize_pr.py +4 -5
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/actions/summarize_release.py +1 -1
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/actions/utils/__init__.py +4 -2
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/actions/utils/common_utils.py +1 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/actions/utils/github_utils.py +19 -8
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/actions/utils/openai_utils.py +50 -22
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/tests/test_dispatch_actions.py +62 -6
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/tests/test_github_utils.py +8 -9
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1/ultralytics_actions.egg-info}/PKG-INFO +114 -66
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/ultralytics_actions.egg-info/SOURCES.txt +1 -0
- ultralytics_actions-0.1.9/actions/dispatch_actions.py +0 -116
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/LICENSE +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/actions/update_file_headers.py +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/actions/update_markdown_code_blocks.py +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/actions/utils/version_utils.py +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/pyproject.toml +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/setup.cfg +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/tests/test_cli_commands.py +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/tests/test_common_utils.py +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/tests/test_file_headers.py +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/tests/test_first_interaction.py +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/tests/test_init.py +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/tests/test_openai_utils.py +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/tests/test_summarize_pr.py +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/tests/test_summarize_release.py +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/tests/test_update_markdown_codeblocks.py +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/tests/test_urls.py +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/ultralytics_actions.egg-info/dependency_links.txt +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/ultralytics_actions.egg-info/entry_points.txt +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/ultralytics_actions.egg-info/requires.txt +0 -0
- {ultralytics_actions-0.1.9 → ultralytics_actions-0.2.1}/ultralytics_actions.egg-info/top_level.txt +0 -0
{ultralytics_actions-0.1.9/ultralytics_actions.egg-info → ultralytics_actions-0.2.1}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ultralytics-actions
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Ultralytics Actions for GitHub automation and PR management.
|
|
5
5
|
Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>
|
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
|
@@ -38,111 +38,159 @@ Dynamic: license-file
|
|
|
38
38
|
|
|
39
39
|
<a href="https://www.ultralytics.com/"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>
|
|
40
40
|
|
|
41
|
-
# 🚀 Ultralytics Actions
|
|
41
|
+
# 🚀 Ultralytics Actions
|
|
42
42
|
|
|
43
|
-
Welcome to
|
|
43
|
+
Welcome to [Ultralytics Actions](https://github.com/ultralytics/actions) - a collection of GitHub Actions and Python tools for automating code quality, PR management, and CI/CD workflows across Ultralytics projects.
|
|
44
44
|
|
|
45
45
|
[](https://github.com/marketplace/actions/ultralytics-actions)
|
|
46
46
|
|
|
47
47
|
[](https://github.com/ultralytics/actions/actions/workflows/ci.yml)
|
|
48
48
|
[](https://github.com/ultralytics/actions/actions/workflows/format.yml)
|
|
49
|
-
[](https://github.com/ultralytics/actions/actions/workflows/scan-prs.yml)
|
|
50
50
|
[](https://codecov.io/github/ultralytics/actions)
|
|
51
51
|
|
|
52
52
|
[](https://discord.com/invite/ultralytics)
|
|
53
53
|
[](https://community.ultralytics.com/)
|
|
54
54
|
[](https://reddit.com/r/ultralytics)
|
|
55
55
|
|
|
56
|
-
##
|
|
56
|
+
## 📦 Repository Contents
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
This repository provides three main components:
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
- **Swift Code:** Formatted with [`swift-format`](https://github.com/swiftlang/swift-format) to maintain a uniform coding style across Swift projects. _(Note: Requires the `macos-latest` runner.)_
|
|
64
|
-
- **Spell Check:** Common misspellings are caught using [codespell](https://github.com/codespell-project/codespell).
|
|
65
|
-
- **Broken Links Check:** Broken links in documentation and Markdown files are identified using [Lychee](https://github.com/lycheeverse/lychee).
|
|
66
|
-
- **PR Summary:** Concise Pull Request summaries are generated using [OpenAI](https://openai.com/) GPT-5, improving clarity and review efficiency.
|
|
67
|
-
- **PR Review:** AI-powered code reviews identify critical bugs, security issues, and code quality concerns with suggested fixes.
|
|
68
|
-
- **Auto-labeling:** Applies relevant labels to issues and PRs via [OpenAI](https://openai.com/) GPT-5 for intelligent categorization.
|
|
60
|
+
1. **[Ultralytics Actions](#ultralytics-actions-main-action)** - Main GitHub Action for AI-powered code formatting, PR summaries, and auto-labeling
|
|
61
|
+
2. **[Standalone Actions](#standalone-actions)** - Reusable composite actions for common CI/CD tasks
|
|
62
|
+
3. **[Python Package](#python-package)** - `ultralytics-actions` package for programmatic use
|
|
69
63
|
|
|
70
|
-
##
|
|
64
|
+
## Ultralytics Actions (Main Action)
|
|
71
65
|
|
|
72
|
-
|
|
66
|
+
AI-powered formatting, labeling, and PR summaries for Python, Swift, and Markdown files.
|
|
73
67
|
|
|
74
|
-
|
|
75
|
-
- **Pull Requests:**
|
|
76
|
-
- Ensures contributions meet formatting standards before merging.
|
|
77
|
-
- Generates a concise summary of changes using GPT-5.
|
|
78
|
-
- Provides AI-powered inline code reviews with suggested fixes for critical issues.
|
|
79
|
-
- Applies relevant labels using GPT-5 for intelligent categorization.
|
|
80
|
-
- **Issues:** Automatically applies relevant labels using GPT-5 when new issues are created.
|
|
68
|
+
### 📄 Features
|
|
81
69
|
|
|
82
|
-
|
|
70
|
+
- **Python Code:** Formatted using [Ruff](https://github.com/astral-sh/ruff), an extremely fast Python linter and formatter
|
|
71
|
+
- **Markdown Files:** Styled with [Prettier](https://github.com/prettier/prettier) to ensure consistent documentation appearance
|
|
72
|
+
- **Docstrings:** Cleaned and standardized using [docformatter](https://github.com/PyCQA/docformatter)
|
|
73
|
+
- **Swift Code:** Formatted with [`swift-format`](https://github.com/swiftlang/swift-format) _(requires `macos-latest` runner)_
|
|
74
|
+
- **Spell Check:** Common misspellings caught using [codespell](https://github.com/codespell-project/codespell)
|
|
75
|
+
- **Broken Links Check:** Broken links identified using [Lychee](https://github.com/lycheeverse/lychee)
|
|
76
|
+
- **PR Summary:** Concise Pull Request summaries generated using [OpenAI](https://openai.com/) GPT-5
|
|
77
|
+
- **PR Review:** AI-powered code reviews identify critical bugs, security issues, and quality concerns with suggested fixes
|
|
78
|
+
- **Auto-labeling:** Applies relevant labels to issues and PRs via [OpenAI](https://openai.com/) GPT-5
|
|
83
79
|
|
|
84
|
-
|
|
80
|
+
### 🛠️ How It Works
|
|
85
81
|
|
|
86
|
-
|
|
82
|
+
Triggers on GitHub events to streamline workflows:
|
|
87
83
|
|
|
88
|
-
|
|
84
|
+
- **Push Events:** Automatically formats code when changes are pushed to `main`
|
|
85
|
+
- **Pull Requests:** Ensures formatting standards, generates summaries, provides AI reviews, and applies labels
|
|
86
|
+
- **Issues:** Automatically applies relevant labels using GPT-5
|
|
89
87
|
|
|
90
|
-
|
|
88
|
+
### 🔧 Setup
|
|
91
89
|
|
|
92
|
-
|
|
93
|
-
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
|
90
|
+
Create `.github/workflows/ultralytics-actions.yml`:
|
|
94
91
|
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
```yaml
|
|
93
|
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
|
97
94
|
|
|
98
|
-
|
|
95
|
+
# Ultralytics Actions https://github.com/ultralytics/actions
|
|
96
|
+
# This workflow formats code and documentation in PRs to Ultralytics standards
|
|
99
97
|
|
|
100
|
-
|
|
101
|
-
issues:
|
|
102
|
-
types: [opened]
|
|
103
|
-
pull_request:
|
|
104
|
-
branches: [main]
|
|
105
|
-
types: [opened, closed, synchronize, review_requested]
|
|
98
|
+
name: Ultralytics Actions
|
|
106
99
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
100
|
+
on:
|
|
101
|
+
issues:
|
|
102
|
+
types: [opened]
|
|
103
|
+
pull_request:
|
|
104
|
+
branches: [main]
|
|
105
|
+
types: [opened, closed, synchronize, review_requested]
|
|
111
106
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
- name: Run Ultralytics Actions
|
|
117
|
-
uses: ultralytics/actions@main
|
|
118
|
-
with:
|
|
119
|
-
token: ${{ secrets.GITHUB_TOKEN }} # Auto-generated token
|
|
120
|
-
labels: true # Auto-label issues/PRs using AI
|
|
121
|
-
python: true # Format Python with Ruff and docformatter
|
|
122
|
-
prettier: true # Format YAML, JSON, Markdown, CSS
|
|
123
|
-
swift: false # Format Swift (requires macos-latest)
|
|
124
|
-
dart: false # Format Dart/Flutter
|
|
125
|
-
spelling: true # Check spelling with codespell
|
|
126
|
-
links: true # Check broken links with Lychee
|
|
127
|
-
summary: true # Generate AI-powered PR summaries
|
|
128
|
-
openai_api_key: ${{ secrets.OPENAI_API_KEY }} # Powers PR summaries, labels and comments
|
|
129
|
-
brave_api_key: ${{ secrets.BRAVE_API_KEY }} # Used for broken link resolution
|
|
130
|
-
```
|
|
107
|
+
permissions:
|
|
108
|
+
contents: write # Modify code in PRs
|
|
109
|
+
pull-requests: write # Add comments and labels to PRs
|
|
110
|
+
issues: write # Add comments and labels to issues
|
|
131
111
|
|
|
132
|
-
|
|
112
|
+
jobs:
|
|
113
|
+
actions:
|
|
114
|
+
runs-on: ubuntu-latest
|
|
115
|
+
steps:
|
|
116
|
+
- name: Run Ultralytics Actions
|
|
117
|
+
uses: ultralytics/actions@main
|
|
118
|
+
with:
|
|
119
|
+
token: ${{ secrets.GITHUB_TOKEN }} # Auto-generated token
|
|
120
|
+
labels: true # Auto-label issues/PRs using AI
|
|
121
|
+
python: true # Format Python with Ruff and docformatter
|
|
122
|
+
prettier: true # Format YAML, JSON, Markdown, CSS
|
|
123
|
+
swift: false # Format Swift (requires macos-latest)
|
|
124
|
+
dart: false # Format Dart/Flutter
|
|
125
|
+
spelling: true # Check spelling with codespell
|
|
126
|
+
links: true # Check broken links with Lychee
|
|
127
|
+
summary: true # Generate AI-powered PR summaries
|
|
128
|
+
openai_api_key: ${{ secrets.OPENAI_API_KEY }} # Powers PR summaries, labels and reviews
|
|
129
|
+
brave_api_key: ${{ secrets.BRAVE_API_KEY }} # Used for broken link resolution
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Standalone Actions
|
|
133
|
+
|
|
134
|
+
Reusable composite actions for common CI/CD tasks. Each can be used independently in your workflows.
|
|
135
|
+
|
|
136
|
+
### 1. Retry Action
|
|
137
|
+
|
|
138
|
+
Retry failed commands with exponential backoff.
|
|
139
|
+
|
|
140
|
+
```yaml
|
|
141
|
+
- uses: ultralytics/actions/retry@main
|
|
142
|
+
with:
|
|
143
|
+
command: npm install
|
|
144
|
+
max_attempts: 3
|
|
145
|
+
timeout_minutes: 5
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
[**📖 Full Documentation →**](retry/README.md)
|
|
149
|
+
|
|
150
|
+
### 2. Cleanup Disk Action
|
|
151
|
+
|
|
152
|
+
Free up disk space on GitHub runners by removing unnecessary packages and files.
|
|
153
|
+
|
|
154
|
+
```yaml
|
|
155
|
+
- uses: ultralytics/actions/cleanup-disk@main
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
[**📖 Full Documentation →**](cleanup-disk/README.md)
|
|
159
|
+
|
|
160
|
+
### 3. Scan PRs Action
|
|
161
|
+
|
|
162
|
+
List open PRs across an organization and auto-merge eligible Dependabot PRs.
|
|
163
|
+
|
|
164
|
+
```yaml
|
|
165
|
+
- uses: ultralytics/actions/scan-prs@main
|
|
166
|
+
with:
|
|
167
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
168
|
+
org: ultralytics # Optional: defaults to ultralytics
|
|
169
|
+
visibility: public # Optional: public, private, internal, or all
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
[**📖 Full Documentation →**](scan-prs/README.md)
|
|
133
173
|
|
|
134
174
|
## Python Package
|
|
135
175
|
|
|
136
|
-
Install
|
|
176
|
+
Install `ultralytics-actions` for programmatic access to action utilities.
|
|
137
177
|
|
|
138
178
|
[](https://pypi.org/project/ultralytics-actions/)
|
|
139
179
|
[](https://clickpy.clickhouse.com/dashboard/ultralytics-actions)
|
|
140
180
|
[](https://pypi.org/project/ultralytics-actions/)
|
|
141
181
|
|
|
142
|
-
```
|
|
182
|
+
```bash
|
|
143
183
|
pip install ultralytics-actions
|
|
144
184
|
```
|
|
145
185
|
|
|
186
|
+
**Available Modules:**
|
|
187
|
+
|
|
188
|
+
- `actions.review_pr` - AI-powered PR review
|
|
189
|
+
- `actions.summarize_pr` - Generate PR summaries
|
|
190
|
+
- `actions.scan_prs` - Scan and manage organization PRs
|
|
191
|
+
- `actions.first_interaction` - Welcome message for new contributors
|
|
192
|
+
- And more in `actions/` directory
|
|
193
|
+
|
|
146
194
|
## 💡 Contribute
|
|
147
195
|
|
|
148
196
|
Ultralytics thrives on community collaboration, and we deeply value your contributions! Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) for details on how you can get involved. We also encourage you to share your feedback through our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey). A huge thank you 🙏 to all our contributors!
|
|
@@ -1,110 +1,158 @@
|
|
|
1
1
|
<a href="https://www.ultralytics.com/"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>
|
|
2
2
|
|
|
3
|
-
# 🚀 Ultralytics Actions
|
|
3
|
+
# 🚀 Ultralytics Actions
|
|
4
4
|
|
|
5
|
-
Welcome to
|
|
5
|
+
Welcome to [Ultralytics Actions](https://github.com/ultralytics/actions) - a collection of GitHub Actions and Python tools for automating code quality, PR management, and CI/CD workflows across Ultralytics projects.
|
|
6
6
|
|
|
7
7
|
[](https://github.com/marketplace/actions/ultralytics-actions)
|
|
8
8
|
|
|
9
9
|
[](https://github.com/ultralytics/actions/actions/workflows/ci.yml)
|
|
10
10
|
[](https://github.com/ultralytics/actions/actions/workflows/format.yml)
|
|
11
|
-
[](https://github.com/ultralytics/actions/actions/workflows/scan-prs.yml)
|
|
12
12
|
[](https://codecov.io/github/ultralytics/actions)
|
|
13
13
|
|
|
14
14
|
[](https://discord.com/invite/ultralytics)
|
|
15
15
|
[](https://community.ultralytics.com/)
|
|
16
16
|
[](https://reddit.com/r/ultralytics)
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## 📦 Repository Contents
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
This repository provides three main components:
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- **Swift Code:** Formatted with [`swift-format`](https://github.com/swiftlang/swift-format) to maintain a uniform coding style across Swift projects. _(Note: Requires the `macos-latest` runner.)_
|
|
26
|
-
- **Spell Check:** Common misspellings are caught using [codespell](https://github.com/codespell-project/codespell).
|
|
27
|
-
- **Broken Links Check:** Broken links in documentation and Markdown files are identified using [Lychee](https://github.com/lycheeverse/lychee).
|
|
28
|
-
- **PR Summary:** Concise Pull Request summaries are generated using [OpenAI](https://openai.com/) GPT-5, improving clarity and review efficiency.
|
|
29
|
-
- **PR Review:** AI-powered code reviews identify critical bugs, security issues, and code quality concerns with suggested fixes.
|
|
30
|
-
- **Auto-labeling:** Applies relevant labels to issues and PRs via [OpenAI](https://openai.com/) GPT-5 for intelligent categorization.
|
|
22
|
+
1. **[Ultralytics Actions](#ultralytics-actions-main-action)** - Main GitHub Action for AI-powered code formatting, PR summaries, and auto-labeling
|
|
23
|
+
2. **[Standalone Actions](#standalone-actions)** - Reusable composite actions for common CI/CD tasks
|
|
24
|
+
3. **[Python Package](#python-package)** - `ultralytics-actions` package for programmatic use
|
|
31
25
|
|
|
32
|
-
##
|
|
26
|
+
## Ultralytics Actions (Main Action)
|
|
33
27
|
|
|
34
|
-
|
|
28
|
+
AI-powered formatting, labeling, and PR summaries for Python, Swift, and Markdown files.
|
|
35
29
|
|
|
36
|
-
|
|
37
|
-
- **Pull Requests:**
|
|
38
|
-
- Ensures contributions meet formatting standards before merging.
|
|
39
|
-
- Generates a concise summary of changes using GPT-5.
|
|
40
|
-
- Provides AI-powered inline code reviews with suggested fixes for critical issues.
|
|
41
|
-
- Applies relevant labels using GPT-5 for intelligent categorization.
|
|
42
|
-
- **Issues:** Automatically applies relevant labels using GPT-5 when new issues are created.
|
|
30
|
+
### 📄 Features
|
|
43
31
|
|
|
44
|
-
|
|
32
|
+
- **Python Code:** Formatted using [Ruff](https://github.com/astral-sh/ruff), an extremely fast Python linter and formatter
|
|
33
|
+
- **Markdown Files:** Styled with [Prettier](https://github.com/prettier/prettier) to ensure consistent documentation appearance
|
|
34
|
+
- **Docstrings:** Cleaned and standardized using [docformatter](https://github.com/PyCQA/docformatter)
|
|
35
|
+
- **Swift Code:** Formatted with [`swift-format`](https://github.com/swiftlang/swift-format) _(requires `macos-latest` runner)_
|
|
36
|
+
- **Spell Check:** Common misspellings caught using [codespell](https://github.com/codespell-project/codespell)
|
|
37
|
+
- **Broken Links Check:** Broken links identified using [Lychee](https://github.com/lycheeverse/lychee)
|
|
38
|
+
- **PR Summary:** Concise Pull Request summaries generated using [OpenAI](https://openai.com/) GPT-5
|
|
39
|
+
- **PR Review:** AI-powered code reviews identify critical bugs, security issues, and quality concerns with suggested fixes
|
|
40
|
+
- **Auto-labeling:** Applies relevant labels to issues and PRs via [OpenAI](https://openai.com/) GPT-5
|
|
45
41
|
|
|
46
|
-
|
|
42
|
+
### 🛠️ How It Works
|
|
47
43
|
|
|
48
|
-
|
|
44
|
+
Triggers on GitHub events to streamline workflows:
|
|
49
45
|
|
|
50
|
-
|
|
46
|
+
- **Push Events:** Automatically formats code when changes are pushed to `main`
|
|
47
|
+
- **Pull Requests:** Ensures formatting standards, generates summaries, provides AI reviews, and applies labels
|
|
48
|
+
- **Issues:** Automatically applies relevant labels using GPT-5
|
|
51
49
|
|
|
52
|
-
|
|
50
|
+
### 🔧 Setup
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
|
52
|
+
Create `.github/workflows/ultralytics-actions.yml`:
|
|
56
53
|
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
```yaml
|
|
55
|
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
|
59
56
|
|
|
60
|
-
|
|
57
|
+
# Ultralytics Actions https://github.com/ultralytics/actions
|
|
58
|
+
# This workflow formats code and documentation in PRs to Ultralytics standards
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
issues:
|
|
64
|
-
types: [opened]
|
|
65
|
-
pull_request:
|
|
66
|
-
branches: [main]
|
|
67
|
-
types: [opened, closed, synchronize, review_requested]
|
|
60
|
+
name: Ultralytics Actions
|
|
68
61
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
on:
|
|
63
|
+
issues:
|
|
64
|
+
types: [opened]
|
|
65
|
+
pull_request:
|
|
66
|
+
branches: [main]
|
|
67
|
+
types: [opened, closed, synchronize, review_requested]
|
|
73
68
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- name: Run Ultralytics Actions
|
|
79
|
-
uses: ultralytics/actions@main
|
|
80
|
-
with:
|
|
81
|
-
token: ${{ secrets.GITHUB_TOKEN }} # Auto-generated token
|
|
82
|
-
labels: true # Auto-label issues/PRs using AI
|
|
83
|
-
python: true # Format Python with Ruff and docformatter
|
|
84
|
-
prettier: true # Format YAML, JSON, Markdown, CSS
|
|
85
|
-
swift: false # Format Swift (requires macos-latest)
|
|
86
|
-
dart: false # Format Dart/Flutter
|
|
87
|
-
spelling: true # Check spelling with codespell
|
|
88
|
-
links: true # Check broken links with Lychee
|
|
89
|
-
summary: true # Generate AI-powered PR summaries
|
|
90
|
-
openai_api_key: ${{ secrets.OPENAI_API_KEY }} # Powers PR summaries, labels and comments
|
|
91
|
-
brave_api_key: ${{ secrets.BRAVE_API_KEY }} # Used for broken link resolution
|
|
92
|
-
```
|
|
69
|
+
permissions:
|
|
70
|
+
contents: write # Modify code in PRs
|
|
71
|
+
pull-requests: write # Add comments and labels to PRs
|
|
72
|
+
issues: write # Add comments and labels to issues
|
|
93
73
|
|
|
94
|
-
|
|
74
|
+
jobs:
|
|
75
|
+
actions:
|
|
76
|
+
runs-on: ubuntu-latest
|
|
77
|
+
steps:
|
|
78
|
+
- name: Run Ultralytics Actions
|
|
79
|
+
uses: ultralytics/actions@main
|
|
80
|
+
with:
|
|
81
|
+
token: ${{ secrets.GITHUB_TOKEN }} # Auto-generated token
|
|
82
|
+
labels: true # Auto-label issues/PRs using AI
|
|
83
|
+
python: true # Format Python with Ruff and docformatter
|
|
84
|
+
prettier: true # Format YAML, JSON, Markdown, CSS
|
|
85
|
+
swift: false # Format Swift (requires macos-latest)
|
|
86
|
+
dart: false # Format Dart/Flutter
|
|
87
|
+
spelling: true # Check spelling with codespell
|
|
88
|
+
links: true # Check broken links with Lychee
|
|
89
|
+
summary: true # Generate AI-powered PR summaries
|
|
90
|
+
openai_api_key: ${{ secrets.OPENAI_API_KEY }} # Powers PR summaries, labels and reviews
|
|
91
|
+
brave_api_key: ${{ secrets.BRAVE_API_KEY }} # Used for broken link resolution
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Standalone Actions
|
|
95
|
+
|
|
96
|
+
Reusable composite actions for common CI/CD tasks. Each can be used independently in your workflows.
|
|
97
|
+
|
|
98
|
+
### 1. Retry Action
|
|
99
|
+
|
|
100
|
+
Retry failed commands with exponential backoff.
|
|
101
|
+
|
|
102
|
+
```yaml
|
|
103
|
+
- uses: ultralytics/actions/retry@main
|
|
104
|
+
with:
|
|
105
|
+
command: npm install
|
|
106
|
+
max_attempts: 3
|
|
107
|
+
timeout_minutes: 5
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
[**📖 Full Documentation →**](retry/README.md)
|
|
111
|
+
|
|
112
|
+
### 2. Cleanup Disk Action
|
|
113
|
+
|
|
114
|
+
Free up disk space on GitHub runners by removing unnecessary packages and files.
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
- uses: ultralytics/actions/cleanup-disk@main
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
[**📖 Full Documentation →**](cleanup-disk/README.md)
|
|
121
|
+
|
|
122
|
+
### 3. Scan PRs Action
|
|
123
|
+
|
|
124
|
+
List open PRs across an organization and auto-merge eligible Dependabot PRs.
|
|
125
|
+
|
|
126
|
+
```yaml
|
|
127
|
+
- uses: ultralytics/actions/scan-prs@main
|
|
128
|
+
with:
|
|
129
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
130
|
+
org: ultralytics # Optional: defaults to ultralytics
|
|
131
|
+
visibility: public # Optional: public, private, internal, or all
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
[**📖 Full Documentation →**](scan-prs/README.md)
|
|
95
135
|
|
|
96
136
|
## Python Package
|
|
97
137
|
|
|
98
|
-
Install
|
|
138
|
+
Install `ultralytics-actions` for programmatic access to action utilities.
|
|
99
139
|
|
|
100
140
|
[](https://pypi.org/project/ultralytics-actions/)
|
|
101
141
|
[](https://clickpy.clickhouse.com/dashboard/ultralytics-actions)
|
|
102
142
|
[](https://pypi.org/project/ultralytics-actions/)
|
|
103
143
|
|
|
104
|
-
```
|
|
144
|
+
```bash
|
|
105
145
|
pip install ultralytics-actions
|
|
106
146
|
```
|
|
107
147
|
|
|
148
|
+
**Available Modules:**
|
|
149
|
+
|
|
150
|
+
- `actions.review_pr` - AI-powered PR review
|
|
151
|
+
- `actions.summarize_pr` - Generate PR summaries
|
|
152
|
+
- `actions.scan_prs` - Scan and manage organization PRs
|
|
153
|
+
- `actions.first_interaction` - Welcome message for new contributors
|
|
154
|
+
- And more in `actions/` directory
|
|
155
|
+
|
|
108
156
|
## 💡 Contribute
|
|
109
157
|
|
|
110
158
|
Ultralytics thrives on community collaboration, and we deeply value your contributions! Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) for details on how you can get involved. We also encourage you to share your feedback through our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey). A huge thank you 🙏 to all our contributors!
|
|
@@ -12,10 +12,13 @@
|
|
|
12
12
|
# │ │ ├── github_utils.py
|
|
13
13
|
# │ │ ├── openai_utils.py
|
|
14
14
|
# │ │ └── common_utils.py
|
|
15
|
+
# │ ├── dispatch_actions.py
|
|
15
16
|
# │ ├── first_interaction.py
|
|
16
17
|
# │ ├── review_pr.py
|
|
18
|
+
# │ ├── scan_prs.py
|
|
17
19
|
# │ ├── summarize_pr.py
|
|
18
20
|
# │ ├── summarize_release.py
|
|
21
|
+
# │ ├── update_file_headers.py
|
|
19
22
|
# │ └── update_markdown_code_blocks.py
|
|
20
23
|
# └── tests/
|
|
21
24
|
# ├── __init__.py
|
|
@@ -23,4 +26,4 @@
|
|
|
23
26
|
# ├── test_summarize_pr.py
|
|
24
27
|
# └── ...
|
|
25
28
|
|
|
26
|
-
__version__ = "0.1
|
|
29
|
+
__version__ = "0.2.1"
|