From 12886925e810b9cec88888aa86e64560840abea5 Mon Sep 17 00:00:00 2001 From: Joachim Jablon Date: Wed, 7 Feb 2024 10:06:45 +0100 Subject: [PATCH] Build default branch on schedule --- coverage_comment/activity.py | 2 +- coverage_comment/main.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/coverage_comment/activity.py b/coverage_comment/activity.py index a805955c..cfa575fb 100644 --- a/coverage_comment/activity.py +++ b/coverage_comment/activity.py @@ -20,7 +20,7 @@ def find_activity( if event_name == "workflow_run": return "post_comment" - if event_name == "push" and is_default_branch: + if (event_name == "push" and is_default_branch) or event_name == "schedule": return "save_coverage_data_files" if event_name not in {"pull_request", "push"}: diff --git a/coverage_comment/main.py b/coverage_comment/main.py index 701a1c14..6b08dae5 100644 --- a/coverage_comment/main.py +++ b/coverage_comment/main.py @@ -77,9 +77,9 @@ def action( ) except activity_module.ActivityNotFound: log.error( - 'This action has only been designed to work for "pull_request", "push" ' - f'or "workflow_run" actions, not "{event_name}". Because there are security ' - "implications. If you have a different usecase, please open an issue, " + 'This action has only been designed to work for "pull_request", "push", ' + f'"workflow_run" or "schedule" actions, not "{event_name}". Because there ' + "are security implications. If you have a different usecase, please open an issue, " "we'll be glad to add compatibility." ) return 1