ultralytics-actions 0.0.42__tar.gz → 0.0.44__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.
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/PKG-INFO +1 -1
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/actions/__init__.py +1 -1
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/actions/first_interaction.py +3 -3
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/actions/summarize_release.py +7 -7
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/actions/utils/common_utils.py +22 -8
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/tests/test_urls.py +12 -5
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/PKG-INFO +1 -1
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/LICENSE +0 -0
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/README.md +0 -0
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/actions/summarize_pr.py +0 -0
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/actions/update_markdown_code_blocks.py +0 -0
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/actions/utils/__init__.py +0 -0
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/actions/utils/github_utils.py +0 -0
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/actions/utils/openai_utils.py +0 -0
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/pyproject.toml +0 -0
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/setup.cfg +0 -0
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/SOURCES.txt +0 -0
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/dependency_links.txt +0 -0
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/entry_points.txt +0 -0
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/requires.txt +0 -0
- {ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ultralytics-actions
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.44
|
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>
|
@@ -47,8 +47,8 @@ def update_issue_pr_content(event, number: int, node_id: str, issue_type: str):
|
|
47
47
|
new_title = "Content Under Review"
|
48
48
|
new_body = """This post has been flagged for review by [Ultralytics Actions](https://ultralytics.com/actions) due to possible spam, abuse, or off-topic content. For more information please see our:
|
49
49
|
|
50
|
-
- [Code of Conduct](https://docs.ultralytics.com/help/
|
51
|
-
- [Security Policy](https://docs.ultralytics.com/help/security)
|
50
|
+
- [Code of Conduct](https://docs.ultralytics.com/help/code-of-conduct/)
|
51
|
+
- [Security Policy](https://docs.ultralytics.com/help/security/)
|
52
52
|
|
53
53
|
For questions or bug reports related to this action please visit https://github.com/ultralytics/actions.
|
54
54
|
|
@@ -285,7 +285,7 @@ def get_first_interaction_response(event, issue_type: str, title: str, body: str
|
|
285
285
|
|
286
286
|
1. For bug reports:
|
287
287
|
- A clear and concise description of the bug
|
288
|
-
- A minimum reproducible example (
|
288
|
+
- A minimum reproducible example [MRE](https://docs.ultralytics.com/help/minimum-reproducible-example/) that demonstrates the issue
|
289
289
|
- Your environment details (OS, Python version, package versions)
|
290
290
|
- Expected behavior vs. actual behavior
|
291
291
|
- Any error messages or logs related to the issue
|
@@ -17,6 +17,7 @@ from .utils import (
|
|
17
17
|
|
18
18
|
# Environment variables
|
19
19
|
CURRENT_TAG = os.getenv("CURRENT_TAG")
|
20
|
+
PREVIOUS_TAG = os.getenv("PREVIOUS_TAG")
|
20
21
|
|
21
22
|
|
22
23
|
def get_release_diff(repo_name: str, previous_tag: str, latest_tag: str, headers: dict) -> str:
|
@@ -145,15 +146,13 @@ def create_github_release(repo_name: str, tag_name: str, name: str, body: str, h
|
|
145
146
|
|
146
147
|
|
147
148
|
def get_previous_tag() -> str:
|
148
|
-
"""
|
149
|
+
"""Retrieves the previous Git tag, excluding the current tag, using the git describe command."""
|
150
|
+
cmd = ["git", "describe", "--tags", "--abbrev=0", "--exclude", CURRENT_TAG]
|
149
151
|
try:
|
150
|
-
# Try to get previous tag first
|
151
|
-
cmd = ["git", "describe", "--tags", "--abbrev=0", "--exclude", CURRENT_TAG]
|
152
152
|
return subprocess.run(cmd, check=True, text=True, capture_output=True).stdout.strip()
|
153
153
|
except subprocess.CalledProcessError:
|
154
|
-
|
155
|
-
|
156
|
-
return subprocess.run(cmd, check=True, text=True, capture_output=True).stdout.strip()
|
154
|
+
print("Failed to get previous tag from git. Using previous commit.")
|
155
|
+
return "HEAD~1"
|
157
156
|
|
158
157
|
|
159
158
|
def main(*args, **kwargs):
|
@@ -163,8 +162,9 @@ def main(*args, **kwargs):
|
|
163
162
|
if not all([action.token, CURRENT_TAG]):
|
164
163
|
raise ValueError("One or more required environment variables are missing.")
|
165
164
|
|
165
|
+
previous_tag = PREVIOUS_TAG or get_previous_tag()
|
166
|
+
|
166
167
|
# Get the diff between the tags
|
167
|
-
previous_tag = get_previous_tag()
|
168
168
|
diff = get_release_diff(action.repository, previous_tag, CURRENT_TAG, action.headers_diff)
|
169
169
|
|
170
170
|
# Get PRs merged between the tags
|
@@ -21,7 +21,7 @@ def clean_url(url):
|
|
21
21
|
|
22
22
|
|
23
23
|
def is_url(url, check=True, max_attempts=3, timeout=2):
|
24
|
-
"""Check if string is URL and
|
24
|
+
"""Check if string is URL and optionally verify it exists."""
|
25
25
|
allow_list = (
|
26
26
|
"localhost",
|
27
27
|
"127.0.0",
|
@@ -56,15 +56,29 @@ def is_url(url, check=True, max_attempts=3, timeout=2):
|
|
56
56
|
|
57
57
|
# Check response
|
58
58
|
if check:
|
59
|
+
headers = {
|
60
|
+
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36",
|
61
|
+
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
62
|
+
"Accept-Language": "en-US,en;q=0.9,es;q=0.8,zh-CN;q=0.7,zh;q=0.6",
|
63
|
+
"Accept-Encoding": "gzip, deflate, br, zstd",
|
64
|
+
"sec-ch-ua": '"Chromium";v="132", "Google Chrome";v="132", "Not_A Brand";v="99"',
|
65
|
+
"sec-ch-ua-mobile": "?0",
|
66
|
+
"sec-ch-ua-platform": '"macOS"',
|
67
|
+
"Sec-Fetch-Site": "none",
|
68
|
+
"Sec-Fetch-Mode": "navigate",
|
69
|
+
"Sec-Fetch-User": "?1",
|
70
|
+
"Sec-Fetch-Dest": "document",
|
71
|
+
"Referer": "https://www.google.com/",
|
72
|
+
"Origin": "https://www.google.com/",
|
73
|
+
}
|
74
|
+
bad_codes = {404, 410, 500, 502, 503, 504}
|
59
75
|
for attempt in range(max_attempts):
|
60
76
|
try:
|
61
|
-
headers =
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
}
|
67
|
-
return requests.head(url, headers=headers, timeout=timeout, allow_redirects=True).status_code < 400
|
77
|
+
response = requests.head(url, headers=headers, timeout=timeout, allow_redirects=True)
|
78
|
+
if response.status_code not in bad_codes:
|
79
|
+
return True
|
80
|
+
response = requests.get(url, headers=headers, timeout=timeout, allow_redirects=True, stream=True)
|
81
|
+
return response.status_code not in bad_codes # Try GET if HEAD fails
|
68
82
|
except Exception:
|
69
83
|
if attempt == max_attempts - 1: # last attempt
|
70
84
|
return False
|
@@ -7,12 +7,19 @@ import pytest
|
|
7
7
|
from actions.utils.common_utils import check_links_in_string, is_url
|
8
8
|
|
9
9
|
URLS = [
|
10
|
-
"https://docs.ultralytics.com/help/CLA/",
|
11
10
|
"https://docs.ultralytics.com/help/contributing",
|
12
|
-
"https://docs.ultralytics.com",
|
13
11
|
"https://ultralytics.com",
|
14
12
|
"https://ultralytics.com/images/bus.jpg",
|
15
13
|
"https://github.com/ultralytics/ultralytics",
|
14
|
+
"https://azure.microsoft.com/",
|
15
|
+
"https://www.tableau.com/",
|
16
|
+
"https://openai.com/research/gpt-4",
|
17
|
+
"https://azure.microsoft.com/en-us/services/machine-learning/",
|
18
|
+
"https://azure.microsoft.com/en-us/products/storage/blobs",
|
19
|
+
"https://www.reuters.com/article/idUSKCN1MK08G/",
|
20
|
+
"https://www.kdnuggets.com/",
|
21
|
+
"https://www.datacamp.com/tutorial/understanding-logistic-regression-python",
|
22
|
+
"https://www.statisticshowto.com/probability-and-statistics/find-outliers/",
|
16
23
|
]
|
17
24
|
|
18
25
|
|
@@ -37,7 +44,7 @@ def test_html_links(verbose):
|
|
37
44
|
|
38
45
|
|
39
46
|
def test_markdown_links(verbose):
|
40
|
-
"""Validates URLs in
|
47
|
+
"""Validates URLs in Markdown links within a given text using check_links_in_string."""
|
41
48
|
text = "Check [Example](https://err.com) or [Test](http://test.org)"
|
42
49
|
result, urls = check_links_in_string(text, verbose, return_bad=True)
|
43
50
|
assert result is False
|
@@ -49,7 +56,7 @@ def test_mixed_formats(verbose):
|
|
49
56
|
text = "A <a href='https://1.com'>link</a> and [markdown](https://2.org) and https://3.net"
|
50
57
|
result, urls = check_links_in_string(text, return_bad=True)
|
51
58
|
assert result is False
|
52
|
-
assert set(urls) == {"https://1.com", "https://
|
59
|
+
assert set(urls) == {"https://1.com", "https://3.net"}
|
53
60
|
|
54
61
|
|
55
62
|
def test_duplicate_urls(verbose):
|
@@ -89,7 +96,7 @@ def test_urls_with_different_tlds(verbose):
|
|
89
96
|
text = "Different TLDs: https://err.ml https://err.org https://err.net https://err.io https://err.ai"
|
90
97
|
result, urls = check_links_in_string(text, verbose, return_bad=True)
|
91
98
|
assert result is False
|
92
|
-
assert set(urls) == {"https://err.ml", "https://err.
|
99
|
+
assert set(urls) == {"https://err.ml", "https://err.io", "https://err.ai"}
|
93
100
|
|
94
101
|
|
95
102
|
def test_case_sensitivity(verbose):
|
{ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ultralytics-actions
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.44
|
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>
|
File without changes
|
File without changes
|
File without changes
|
{ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/actions/update_markdown_code_blocks.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/requires.txt
RENAMED
File without changes
|
{ultralytics_actions-0.0.42 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/top_level.txt
RENAMED
File without changes
|