diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ea0fdb1..8a5ad75 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,9 @@ on: branches: [ "main" ] workflow_dispatch: +permissions: + contents: read + jobs: deploy: runs-on: ubuntu-latest @@ -13,7 +16,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: "3.10" diff --git a/main.py b/main.py index 4c442a9..0b70ffc 100644 --- a/main.py +++ b/main.py @@ -161,7 +161,9 @@ async def count_messages(message_content, counter): uuid = extract_source_uuid(message_content) source_name = extract_source_name(message_content) await counter.update_string_map(uuid, source_name) - send_message(counter.string_map, PHONE_NUMBER) + # Use get_recipient() to respect debug mode - send count update to self in debug mode + recipient = get_recipient() + send_message(counter.string_map, recipient) async def scheduled_task(counter): diff --git a/tests/test_main.py b/tests/test_main.py index f1025a0..c0dade8 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -185,7 +185,7 @@ class TestShouldCount: assert should_count(message_content) is False def test_should_count_empty_content(self): - """Test that empty content should not be counted - empty dict returns True currently""" + """Test that empty dict returns True (no sticker found means message is counted)""" from main import should_count # Empty dict is counted (no sticker found) assert should_count({}) is True