Auto-redeploy Cloud Run actions and shorten trigger comments (#898)

This commit is contained in:
Glenn Jocher
2026-09-05 22:12:29 +02:00
committed by GitHub
parent ed8e78f4f2
commit 03d7f237b1
4 changed files with 15 additions and 10 deletions
+10
View File
@@ -18,6 +18,16 @@ concurrency:
queue: max
jobs:
deploy-actions:
if: github.repository == 'ultralytics/actions' && github.event_name == 'push'
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Redeploy Cloud Run actions service
env:
GH_TOKEN: ${{ secrets._GITHUB_TOKEN }}
run: gh workflow run deploy_cloud_run.yml --repo ultralytics/assistant --ref main -f actions=true
check:
if: github.repository == 'ultralytics/actions' && github.actor == 'glenn-jocher' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
+1 -1
View File
@@ -28,4 +28,4 @@
# ├── test_summarize_pr.py
# └── ...
__version__ = "0.3.21"
__version__ = "0.3.22"
+3 -5
View File
@@ -144,17 +144,15 @@ def update_comment(event, comment_body: str, command: str, triggered_actions: li
timestamp = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S UTC")
failed = all(action.get("error") for action in triggered_actions)
status = (
"No GitHub Actions workflows were started" if failed else "GitHub Actions below triggered via workflow dispatch"
)
status = "No GitHub Actions workflows were started" if failed else "Actions triggered"
summary = f"""
## ⚡ Actions Trigger
{ACTIONS_CREDIT}
{status} for this PR at {timestamp} with `{command}` command
(available commands are `{RUN_ALL_KEYWORD}`, `{RUN_CI_KEYWORD}`, and `{RUN_DOCKER_KEYWORD}`):
{status} via `{command}` at {timestamp}.<br>
Commands: `{RUN_ALL_KEYWORD}`, `{RUN_CI_KEYWORD}`, `{RUN_DOCKER_KEYWORD}`.
"""
+1 -4
View File
@@ -217,10 +217,7 @@ def test_update_comment_function():
assert "Actions Trigger" in kwargs["json"]["body"]
assert "CI Workflow" in kwargs["json"]["body"]
assert "2023-01-01 12:00:00 UTC" in kwargs["json"]["body"]
assert (
f"(available commands are `{RUN_ALL_KEYWORD}`, `{RUN_CI_KEYWORD}`, and `{RUN_DOCKER_KEYWORD}`):"
in kwargs["json"]["body"]
)
assert f"Commands: `{RUN_ALL_KEYWORD}`, `{RUN_CI_KEYWORD}`, `{RUN_DOCKER_KEYWORD}`." in kwargs["json"]["body"]
def test_update_comment_skips_empty_actions():