Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nexus7 #25

Merged
merged 3 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/nexus-trusted-traveler-scheduler-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ on:
## │ │ │ │ │
## │ │ │ │ │
## * * * * *
# schedule:
schedule:
# ## Testing run every 5 minutes
# - cron: '*/5 * * * *'

## Run every 5 hours on minute 37
# - cron: '37 */5 * * *'
- cron: '37 */5 * * *'

env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_NEXUS }} # Sends to the nexus channel. In the format of: slack://xxx/xxx/xxx
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations
from datetime import datetime
import re

from typing import TYPE_CHECKING, List

Expand Down Expand Up @@ -52,15 +53,25 @@

title = "Trusted Traveler Scheduler"

apobj = apprise.Apprise(self.notification_urls)
result = apobj.notify(title=title, body=body, body_format=apprise.NotifyFormat.TEXT)
pattern = r"Sun|Fri|Sat"
match = re.search(pattern, body)
print("GarDebug: in sending notification")

# If you encounter Apprise errors, https://github.com/caronc/apprise/wiki/Development_LogCapture
# may be useful.
if result is None:
print('{datetime.today():%Y/%m/%d %H:%M:%S}: error: No notifications sent (configuration error)')
elif result is False:
print('{datetime.today():%Y/%m/%d %H:%M:%S}: error: At least 1 notification failed to send')
if match:
print(f"GarDebug: Sending notification: {body}")

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.

apobj = apprise.Apprise(self.notification_urls)
result = apobj.notify(title=title, body=body, body_format=apprise.NotifyFormat.TEXT)

# If you encounter Apprise errors, https://github.com/caronc/apprise/wiki/Development_LogCapture
# may be useful.
if result is None:
print('{datetime.today():%Y/%m/%d %H:%M:%S}: error: No notifications sent (configuration error)')
elif result is False:
print('{datetime.today():%Y/%m/%d %H:%M:%S}: error: At least 1 notification failed to send')

else:
print(f"GarDebug: Skipping notification: {body}")

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.

def new_appointment(self, location_id: int, appointments: List[Schedule]) -> None:
"""
Expand Down