From ddce9aa60468bbf4ca7d024ead7230617e9bd75f Mon Sep 17 00:00:00 2001 From: Spuds Date: Sat, 13 Apr 2024 09:05:32 -0500 Subject: [PATCH 1/5] ! close #2857 Confusing account pending deletion account actions --- sources/ElkArte/AdminController/ManageMembers.php | 2 +- sources/ElkArte/Languages/ManageMembers/English.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/ElkArte/AdminController/ManageMembers.php b/sources/ElkArte/AdminController/ManageMembers.php index 52b719a3ee..bf4d6d45a9 100644 --- a/sources/ElkArte/AdminController/ManageMembers.php +++ b/sources/ElkArte/AdminController/ManageMembers.php @@ -868,7 +868,7 @@ public function action_browse() { $context['allowed_actions'] = [ 'reject' => $txt['admin_browse_w_approve_deletion'], - 'ok' => $txt['admin_browse_w_reject'], + 'ok' => $txt['admin_browse_w_reject_delete'], ]; } else diff --git a/sources/ElkArte/Languages/ManageMembers/English.php b/sources/ElkArte/Languages/ManageMembers/English.php index a8a1c6732f..8687c772f5 100644 --- a/sources/ElkArte/Languages/ManageMembers/English.php +++ b/sources/ElkArte/Languages/ManageMembers/English.php @@ -108,6 +108,7 @@ $txt['admin_browse_w_approve_deletion'] = 'Approve (Delete Accounts)'; $txt['admin_browse_w_email'] = 'and send email'; $txt['admin_browse_w_approve_require_activate'] = 'Approve and require activation'; +$txt['admin_browse_w_reject_delete'] = 'Reject (Keep Accounts)'; $txt['admin_browse_filter_by'] = 'Filter By'; $txt['admin_browse_filter_show'] = 'Displaying'; From c39c8be7b1dbf46ba4456847f4da595dbfc3a09d Mon Sep 17 00:00:00 2001 From: Spuds Date: Sat, 13 Apr 2024 11:55:50 -0500 Subject: [PATCH 2/5] ! close #2487 option shows up in search when its disabled in Core Features --- sources/ElkArte/AdminController/Admin.php | 7 ++-- .../ElkArte/AdminController/CoreFeatures.php | 2 +- .../AdminController/ManageCalendarModule.php | 5 +++ .../AdminController/ManageDraftsModule.php | 7 +++- .../AdminController/ManageEmojiModule.php | 2 +- .../AdminController/ManageFeatures.php | 17 +++++++++ .../AdminController/ManageMaillist.php | 37 +++++++++++++++++++ .../AdminController/ManageSecurity.php | 7 ++++ .../ElkArte/AdminController/ManageTopics.php | 1 - sources/ElkArte/AdminSettingsSearch.php | 5 +++ 10 files changed, 83 insertions(+), 7 deletions(-) diff --git a/sources/ElkArte/AdminController/Admin.php b/sources/ElkArte/AdminController/Admin.php index 760cfa83a1..ea2ce807b1 100644 --- a/sources/ElkArte/AdminController/Admin.php +++ b/sources/ElkArte/AdminController/Admin.php @@ -792,7 +792,7 @@ public function action_search_internal() // Load a lot of language files. $language_files = [ 'Help', 'ManageMail', 'ManageSettings', 'ManageBoards', 'ManagePaid', 'ManagePermissions', 'Search', - 'Login', 'ManageSmileys', 'Maillist', 'Mentions' + 'Login', 'ManageSmileys', 'Maillist', 'Mentions', 'Addons' ]; // All the files we need to include to search for settings @@ -818,6 +818,8 @@ public function action_search_internal() ['settings_search', 'area=languages;sa=settings', ManageLanguages::class], ['settings_search', 'area=mailqueue;sa=settings', ManageMail::class], ['settings_search', 'area=maillist;sa=emailsettings', ManageMaillist::class], + ['filter_search', 'area=maillist;sa=emailsettings', ManageMaillist::class], + ['parser_search', 'area=maillist;sa=emailsettings', ManageMaillist::class], ['settings_search', 'area=membergroups;sa=settings', ManageMembergroups::class], ['settings_search', 'area=news;sa=settings', ManageNews::class], ['settings_search', 'area=paidsubscribe;sa=settings', ManagePaid::class], @@ -885,8 +887,7 @@ public function action_search_member() * This file allows the user to search the wiki documentation for a little help. * * What it does: - * - * - Creates an exception since GitHub does not yet support API wiki searches so the connection + * - Creates an exception since GitHub does not yet support API wiki searches so the connection * will fail. */ public function action_search_doc() diff --git a/sources/ElkArte/AdminController/CoreFeatures.php b/sources/ElkArte/AdminController/CoreFeatures.php index caa7fc81be..e92cf22d03 100644 --- a/sources/ElkArte/AdminController/CoreFeatures.php +++ b/sources/ElkArte/AdminController/CoreFeatures.php @@ -188,7 +188,7 @@ public function settings() global $modSettings; require_once(SUBSDIR . '/Mentions.subs.php'); - require_once(SUBSDIR . 'Notification.subs.php'); + require_once(SUBSDIR . '/Notification.subs.php'); // Makes all the like/rlike mentions invisible (or visible) toggleMentionsVisibility('likemsg', !empty($value)); diff --git a/sources/ElkArte/AdminController/ManageCalendarModule.php b/sources/ElkArte/AdminController/ManageCalendarModule.php index 434d7d8b86..aec82ad925 100644 --- a/sources/ElkArte/AdminController/ManageCalendarModule.php +++ b/sources/ElkArte/AdminController/ManageCalendarModule.php @@ -397,6 +397,11 @@ private function _settings() */ public function settings_search() { + if (isModuleEnabled('calendar')) + { return $this->_settings(); + } + + return ['check', 'dummy_calendar']; } } diff --git a/sources/ElkArte/AdminController/ManageDraftsModule.php b/sources/ElkArte/AdminController/ManageDraftsModule.php index 2eaa76561d..56bba07388 100644 --- a/sources/ElkArte/AdminController/ManageDraftsModule.php +++ b/sources/ElkArte/AdminController/ManageDraftsModule.php @@ -294,6 +294,11 @@ private function _settings() */ public function settings_search() { - return $this->_settings(); + if (isModuleEnabled('drafts')) + { + return $this->_settings(); + } + + return ['check', 'dummy_drafts']; } } diff --git a/sources/ElkArte/AdminController/ManageEmojiModule.php b/sources/ElkArte/AdminController/ManageEmojiModule.php index dfacfc6e90..05e15b6530 100644 --- a/sources/ElkArte/AdminController/ManageEmojiModule.php +++ b/sources/ElkArte/AdminController/ManageEmojiModule.php @@ -80,7 +80,7 @@ public static function integrate_save_smiley_settings() /** * Unzips a selected Emoji set if it has not already been extracted * - * @param \ElkArte\Helper\HttpReq $req + * @param HttpReq $req */ private static function unZipEmoji($req) { diff --git a/sources/ElkArte/AdminController/ManageFeatures.php b/sources/ElkArte/AdminController/ManageFeatures.php index 3734764c49..b569621653 100644 --- a/sources/ElkArte/AdminController/ManageFeatures.php +++ b/sources/ElkArte/AdminController/ManageFeatures.php @@ -620,6 +620,7 @@ private function _likesSettings() array('int', 'likeWaitCount', 6), array('check', 'likeRestrictAdmins'), array('check', 'likeAllowSelf'), + array('check', 'useLikesNotViews'), '', array('int', 'likeDisplayLimit', 6) ); @@ -1796,6 +1797,14 @@ public function layoutSettings_search() */ public function karmaSettings_search() { + global $modSettings; + + // Karma - On or off? + if (empty($modSettings['karmaMode'])) + { + return ['check', 'dummy_karma']; + } + return $this->_karmaSettings(); } @@ -1804,6 +1813,14 @@ public function karmaSettings_search() */ public function likesSettings_search() { + global $modSettings; + + // Likes - On or off? + if (empty($modSettings['enable_likes'])) + { + return ['check', 'dummy_likes']; + } + return $this->_likesSettings(); } diff --git a/sources/ElkArte/AdminController/ManageMaillist.php b/sources/ElkArte/AdminController/ManageMaillist.php index 9adff6dd3a..e1591041af 100644 --- a/sources/ElkArte/AdminController/ManageMaillist.php +++ b/sources/ElkArte/AdminController/ManageMaillist.php @@ -1064,6 +1064,21 @@ private function _filtersSettings() return $config_vars; } + /** + * Return the form settings for use in admin search + */ + public function filter_search() + { + global $modSettings; + + if (empty($modSettings['maillist_enabled'])) + { + return ['check', 'filter_name']; + } + + return $this->_filtersSettings(); + } + /** * Deletes a filter from the system / database */ @@ -1456,6 +1471,21 @@ private function _parsersSettings() return $config_vars; } + /** + * Return the form settings for use in admin search + */ + public function parser_search() + { + global $modSettings; + + if (empty($modSettings['maillist_enabled'])) + { + return ['check', 'filter_name']; + } + + return $this->_parsersSettings(); + } + /** * Removes a parser from the system and database */ @@ -1714,6 +1744,13 @@ private function _settings() */ public function settings_search() { + global $modSettings; + + if (empty($modSettings['maillist_enabled'])) + { + return ['check', 'maillist_enabled']; + } + return $this->_settings(); } diff --git a/sources/ElkArte/AdminController/ManageSecurity.php b/sources/ElkArte/AdminController/ManageSecurity.php index c049d7d565..130311bba7 100644 --- a/sources/ElkArte/AdminController/ManageSecurity.php +++ b/sources/ElkArte/AdminController/ManageSecurity.php @@ -342,6 +342,13 @@ private function _spamSettings() */ public function moderationSettings_search() { + global $modSettings; + + if (empty($modSettings['warning_enable'])) + { + return ['check', 'dummy_enable']; + } + return $this->_moderationSettings(); } diff --git a/sources/ElkArte/AdminController/ManageTopics.php b/sources/ElkArte/AdminController/ManageTopics.php index 85c4ee386b..f2ae903f9f 100644 --- a/sources/ElkArte/AdminController/ManageTopics.php +++ b/sources/ElkArte/AdminController/ManageTopics.php @@ -140,7 +140,6 @@ private function _settings() // Hot topics (etc)... array('int', 'hotTopicPosts', 'postinput' => $txt['manageposts_posts']), array('int', 'hotTopicVeryPosts', 'postinput' => $txt['manageposts_posts']), - array('check', 'useLikesNotViews'), '', // All, next/prev... array('int', 'enableAllMessages', 'postinput' => $txt['manageposts_posts'], 'subtext' => $txt['enableAllMessages_zero']), diff --git a/sources/ElkArte/AdminSettingsSearch.php b/sources/ElkArte/AdminSettingsSearch.php index a8bf1c0359..4197a44ac7 100644 --- a/sources/ElkArte/AdminSettingsSearch.php +++ b/sources/ElkArte/AdminSettingsSearch.php @@ -173,6 +173,11 @@ private function _get_label($var) return $txt['groups_' . $var[1]]; } + if (!is_array($var) && isset($txt[$var])) + { + return $txt[$var]; + } + return $save ?? $var[1]; } From e57c6a48b27b74bdcd3ec7cc0e4c5a8082a57fba Mon Sep 17 00:00:00 2001 From: Spuds Date: Sun, 14 Apr 2024 08:48:44 -0500 Subject: [PATCH 3/5] ! close #2355 Add a way to test email settings --- sources/ElkArte/AdminController/Admin.php | 1 + .../ElkArte/AdminController/Maintenance.php | 2 +- .../ElkArte/AdminController/ManageMail.php | 52 ++++++++++++++++- sources/ElkArte/Languages/Admin/English.php | 1 + sources/ElkArte/Languages/Index/English.php | 5 -- .../ElkArte/Languages/ManageMail/English.php | 7 +++ themes/default/ManageMail.template.php | 58 +++++++++++++++++++ 7 files changed, 119 insertions(+), 7 deletions(-) diff --git a/sources/ElkArte/AdminController/Admin.php b/sources/ElkArte/AdminController/Admin.php index ea2ce807b1..1284b2280b 100644 --- a/sources/ElkArte/AdminController/Admin.php +++ b/sources/ElkArte/AdminController/Admin.php @@ -517,6 +517,7 @@ private function loadMenu() 'class' => 'i-envelope-blank i-admin', 'subsections' => array( 'browse' => array($txt['mailqueue_browse'], 'admin_forum'), + 'test' => array($txt['mailqueue_test'], 'admin_forum'), 'settings' => array($txt['mailqueue_settings'], 'admin_forum'), ), ), diff --git a/sources/ElkArte/AdminController/Maintenance.php b/sources/ElkArte/AdminController/Maintenance.php index fccf354fe4..f6ec9db2ed 100644 --- a/sources/ElkArte/AdminController/Maintenance.php +++ b/sources/ElkArte/AdminController/Maintenance.php @@ -28,7 +28,7 @@ use ElkArte\User; /** - * Entry point class for all of the maintenance ,routine, members, database, + * Entry point class for all maintenance, routine, members, database, * attachments, topics and hooks * * @package Maintenance diff --git a/sources/ElkArte/AdminController/ManageMail.php b/sources/ElkArte/AdminController/ManageMail.php index 238926ceff..8cc0decd29 100644 --- a/sources/ElkArte/AdminController/ManageMail.php +++ b/sources/ElkArte/AdminController/ManageMail.php @@ -22,6 +22,7 @@ use ElkArte\Languages\Loader; use ElkArte\Languages\Txt; use ElkArte\SettingsForm\SettingsForm; +use ElkArte\User; /** * This class is the administration mailing controller. @@ -30,6 +31,7 @@ * * - It handles mail configuration, * - It displays and allows to remove items from the mail queue. + * - It handles sending a test email * * @package Mail */ @@ -54,12 +56,13 @@ public function action_index() 'browse' => array($this, 'action_browse', 'permission' => 'admin_forum'), 'clear' => array($this, 'action_clear', 'permission' => 'admin_forum'), 'settings' => array($this, 'action_mailSettings_display', 'permission' => 'admin_forum'), + 'test' => array($this, 'action_test_email', 'permission' => 'admin_forum'), ); // Action control $action = new Action('manage_mail'); - // By default we want to browse, call integrate_sa_manage_mail + // By default, we want to browse, call integrate_sa_manage_mail $subAction = $action->initialize($subActions, 'browse'); // Final bits @@ -71,6 +74,11 @@ public function action_index() 'title' => 'mailqueue_title', 'class' => 'i-envelope', 'description' => 'mailqueue_desc', + 'tabs' => [ + 'test' => [ + 'description' => $txt['mail_send_desc'], + ], + ] ]); // Call the right function for this sub-action. @@ -448,4 +456,46 @@ public function action_browse() createList($listOptions); } + + /** + * Test email action + */ + public function action_test_email() + { + global $context, $txt; + + require_once(SUBSDIR . '/Mail.subs.php'); + + theme()->getTemplates()->load('ManageMail'); + $context['page_title'] = $txt['mail_test']; + $context['sub_template'] = 'mail_test'; + + if (isset($this->_req->post->send)) + { + checkSession(); + validateToken('admin-mailtest'); + + $sendTo = $this->_req->getPost('send_to', 'trim'); + $subject = $this->_req->getPost('subject', 'Util::htmlspecialchars', ''); + $message = $this->_req->getPost('message', 'Util::htmlspecialchars', ''); + + $sendTo = $sendTo ?: User::$info->email; + if (empty($subject) || empty($message)) + { + $result = false; + } + else + { + // Let 'er rip! + $result = sendmail($sendTo, $subject, $message, null, null, true, 0); + } + + redirectexit('action=admin;area=mailqueue;sa=test;result=' . ($result ? 'pass' : 'fail')); + } + + createToken('admin-mailtest'); + + $result = $this->_req->getQuery('result', 'trim', ''); + $context['result'] = $result; + } } diff --git a/sources/ElkArte/Languages/Admin/English.php b/sources/ElkArte/Languages/Admin/English.php index 6fde32496a..d57cb20b64 100644 --- a/sources/ElkArte/Languages/Admin/English.php +++ b/sources/ElkArte/Languages/Admin/English.php @@ -730,6 +730,7 @@ $txt['mailqueue_browse'] = 'Browse Queue'; $txt['mailqueue_settings'] = 'Settings'; +$txt['mailqueue_test'] = 'Test Email'; $txt['admin_search'] = 'Quick Search'; $txt['admin_search_type_internal'] = 'Task/Setting'; diff --git a/sources/ElkArte/Languages/Index/English.php b/sources/ElkArte/Languages/Index/English.php index 51fe409464..d87a628220 100644 --- a/sources/ElkArte/Languages/Index/English.php +++ b/sources/ElkArte/Languages/Index/English.php @@ -450,11 +450,6 @@ $txt['unwatch'] = 'Unwatch'; $txt['watch'] = 'Watch'; -$txt['sendtopic_sender_name'] = 'Your name'; -$txt['sendtopic_sender_email'] = 'Your email address'; -$txt['sendtopic_receiver_name'] = 'Recipient\'s name'; -$txt['sendtopic_receiver_email'] = 'Recipient\'s email address'; - $txt['allow_user_email'] = 'Allow users to email me'; $txt['check_all'] = 'Check all'; diff --git a/sources/ElkArte/Languages/ManageMail/English.php b/sources/ElkArte/Languages/ManageMail/English.php index 22b816a7fc..a27225a25f 100644 --- a/sources/ElkArte/Languages/ManageMail/English.php +++ b/sources/ElkArte/Languages/ManageMail/English.php @@ -13,6 +13,13 @@ $txt['smtp_username'] = 'SMTP username'; $txt['smtp_password'] = 'SMTP password'; +$txt['mail_test'] = 'Test Email'; +$txt['mail_test_fail'] = 'Email Failure'; +$txt['mail_test_pass'] = 'Email Sent'; +$txt['mail_test_header'] = 'Test Sending Email'; +$txt['mail_send_to'] = 'Send To'; +$txt['mail_send_desc'] = 'From this area you can send Email, from this site, to ensure your mail settings are valid/correct.
The default to email address is yours, but you can email to a testing service (such as www.mail-tester.com) to validate compliance with DMARC, DKIM, SPF, rDNS, etc).'; + $txt['mail_queue'] = 'Enable mail queue'; $txt['mail_period_limit'] = 'Maximum emails to send per minute'; $txt['mail_period_limit_desc'] = '(Set to 0 to disable)'; diff --git a/themes/default/ManageMail.template.php b/themes/default/ManageMail.template.php index 71c835cc7f..b9571e0ffe 100644 --- a/themes/default/ManageMail.template.php +++ b/themes/default/ManageMail.template.php @@ -38,3 +38,61 @@ function template_mail_queue() echo ' '; } + +/** + * Template for testing outbound email. + */ +function template_mail_test() +{ + global $context, $txt, $scripturl; + + // Some result? + if (!empty($context['result'])) + { + if ($context['result'] === 'fail') + { + $result_txt = sprintf($txt['mail_test_fail'], $scripturl . '?action=admin;area=logs;sa=errorlog;desc'); + } + else + { + $result_txt = $txt['mail_test_pass']; + } + + echo ' +
', $result_txt, '
'; + } + + echo ' +
+

+ ', $txt['mail_test_header'], ' +

+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ + + +
+
+
'; +} From 15d51297236feb65f4a7225fc1eef7a9d52eb941 Mon Sep 17 00:00:00 2001 From: Spuds Date: Sun, 14 Apr 2024 09:54:46 -0500 Subject: [PATCH 4/5] ! better mention handling ignore/buddy/etc --- .../AbstractNotificationMessage.php | 77 +++++++++++++++---- 1 file changed, 60 insertions(+), 17 deletions(-) diff --git a/sources/ElkArte/Mentions/MentionType/AbstractNotificationMessage.php b/sources/ElkArte/Mentions/MentionType/AbstractNotificationMessage.php index 9aed0a75a7..f01ea08832 100644 --- a/sources/ElkArte/Mentions/MentionType/AbstractNotificationMessage.php +++ b/sources/ElkArte/Mentions/MentionType/AbstractNotificationMessage.php @@ -234,30 +234,73 @@ protected function _validateMemberRelationship($fromMember, $toMember) return true; } - $ignoreUsers = array_map('intval', explode(',', $this->_to_members_data[$toMember]['pm_ignore_list'])); - $buddyList = array_map('intval', explode(',', $this->_to_members_data[$toMember]['buddy_list'])); - // Not those on my ignore list - if ($this->_to_members_data[$toMember]['notify_from'] === 1 && in_array($fromMember, $ignoreUsers, true)) + if ($this->_to_members_data[$toMember]['notify_from'] === 1) { - return false; + return $this->notOnIgnoreList($toMember, $fromMember); } - // Only friends and pesky admins/global mods + // Only friends and pesky admins if ($this->_to_members_data[$toMember]['notify_from'] === 2) { - if (in_array($fromMember, $buddyList, true)) - { - return true; - } + return $this->isBuddyNotificationAllowed($fromMember, $toMember); + } - MembersList::load($fromMember, false, 'profile'); - $fromProfile = MembersList::get($fromMember); - $groups = array_map('intval', array_merge([$fromProfile['id_group'], $fromProfile['id_post_group']], (empty($fromProfile['additional_groups']) ? [] : explode(',', $fromProfile['additional_groups'])))); - if (in_array(1, $groups, true) || in_array(2, $groups, true)) - { - return true; - } + return false; + } + + /** + * Check if a member is not on the ignore list of another member + * + * @param int $toMember The ID of the member to check if they are on the ignore list + * @param int $fromMember The ID of the member who is being checked against the ignore list + * @return bool Returns true if the fromMember is not on the ignore list of the toMember, false otherwise + */ + public function notOnIgnoreList(int $toMember, int $fromMember): bool + { + if (empty($this->_to_members_data[$toMember]['pm_ignore_list'])) + { + return true; + } + + $ignoreUsers = array_map('intval', explode(',', $this->_to_members_data[$toMember]['pm_ignore_list'])); + if (in_array($fromMember, $ignoreUsers, true)) + { + return false; + } + + return true; + } + + /** + * Determines if buddy notification is allowed between two members. + * + * @param int $fromMember The member ID of the sender. + * @param int $toMember The member ID of the recipient. + * + * @return bool True if buddy notification is allowed, false otherwise. + */ + public function isBuddyNotificationAllowed(int $fromMember, int $toMember): bool + { + // Admins/Global mods get a pass + MembersList::load($fromMember, false, 'profile'); + $fromProfile = MembersList::get($fromMember); + $groups = array_map('intval', array_merge([$fromProfile['id_group'], $fromProfile['id_post_group']], (empty($fromProfile['additional_groups']) ? [] : explode(',', $fromProfile['additional_groups'])))); + if (in_array(1, $groups, true) || in_array(2, $groups, true)) + { + return true; + } + + // No buddies, no notification either + if (empty($this->_to_members_data[$toMember]['buddy_list'])) + { + return false; + } + + $buddyList = array_map('intval', explode(',', $this->_to_members_data[$toMember]['buddy_list'])); + if (in_array($fromMember, $buddyList, true)) + { + return true; } return false; From 20b6f6ec19d4b2bc4dfea2b51134dfc9ecc49b90 Mon Sep 17 00:00:00 2001 From: Spuds Date: Sun, 14 Apr 2024 10:29:13 -0500 Subject: [PATCH 5/5] ! coverage reports now requires token --- .github/setup-results.sh | 3 ++- .github/setup-selenium.sh | 7 ++++++- .github/workflows/tests.yaml | 9 ++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/setup-results.sh b/.github/setup-results.sh index 3f5a1535b4..00ca6c57f7 100755 --- a/.github/setup-results.sh +++ b/.github/setup-results.sh @@ -8,6 +8,7 @@ set +x # Passed params DB=$1 PHP_VERSION=$2 +CODECOV_TOKEN=$3 # Build a config string for PHPUnit CONFIG="--verbose --configuration .github/phpunit-${DB}.xml" @@ -18,5 +19,5 @@ vendor/bin/phpunit ${CONFIG} # Agents will merge all coverage data... if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]] then - bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.xml' + bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.xml' -t "${CODECOV_TOKEN}" fi diff --git a/.github/setup-selenium.sh b/.github/setup-selenium.sh index 1c6eb7b360..59678735a2 100755 --- a/.github/setup-selenium.sh +++ b/.github/setup-selenium.sh @@ -6,6 +6,11 @@ set -e set -x +# Passed params +DB=$1 +PHP_VERSION=$2 +CODECOV_TOKEN=$3 + # Per actions in the tests.yaml file # # Current Versions for Ref @@ -42,6 +47,6 @@ else # Agents will merge all coverage data... if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]] then - bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.clover' + bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.xml' -t "${CODECOV_TOKEN}" fi fi \ No newline at end of file diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c19fb36cbb..e355c41b08 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -96,7 +96,8 @@ jobs: env: DB: ${{ matrix.db }} PHP_VERSION: ${{ matrix.php }} - run: .github/setup-selenium.sh $DB $PHP_VERSION + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: .github/setup-selenium.sh $DB $PHP_VERSION $CODECOV_TOKEN working-directory: ./elkarte continue-on-error: true @@ -244,7 +245,8 @@ jobs: env: DB: ${{steps.database-type.outputs.db}} PHP_VERSION: ${{ matrix.php }} - run: .github/setup-results.sh $DB $PHP_VERSION + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: .github/setup-results.sh $DB $PHP_VERSION $CODECOV_TOKEN working-directory: ./elkarte # END MySQL and MariaDB Job @@ -323,6 +325,7 @@ jobs: env: DB: ${{steps.database-type.outputs.db}} PHP_VERSION: ${{ matrix.php }} - run: .github/setup-results.sh $DB $PHP_VERSION + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: .github/setup-results.sh $DB $PHP_VERSION $CODECOV_TOKEN working-directory: ./elkarte # END Postgres Job \ No newline at end of file