Auto-redeploy Cloud Run actions and shorten trigger comments (#898)
This commit is contained in:
@@ -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
@@ -28,4 +28,4 @@
|
||||
# ├── test_summarize_pr.py
|
||||
# └── ...
|
||||
|
||||
__version__ = "0.3.21"
|
||||
__version__ = "0.3.22"
|
||||
|
||||
@@ -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}`.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user