-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from RAHB-REALTORS-Association/1.1.0
v1.1.0
- Loading branch information
Showing
6 changed files
with
89 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: RCN Roster | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 16 15 * *' # Runs at 16:00 UTC on the 15th of every month | ||
|
||
jobs: | ||
generate-rcn-report: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
REDASH_URL: ${{ secrets.REDASH_URL }} # Base Redash URL | ||
API_KEY: ${{ secrets.REDASH_API_KEY }} # RCN API key | ||
SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }} | ||
FROM_EMAIL: ${{ secrets.RCN_FROM_EMAIL }} | ||
TO_EMAILS: ${{ secrets.RCN_TO_EMAILS }} | ||
# Non-sensitive information can be set directly | ||
QUERY_IDS: "15" # RCN Active Members | ||
TITLES: "RCN Active Members" | ||
LOGO_URL: "https://s1.cdn.rahb.ca/rahbca/wp-content/uploads/2018/10/RAHB-logo_hztrans_video.png" | ||
TIMESTAMP_FORMAT: "%Y-%m-%d" | ||
SUBJECT: "RAHB Active RCN members list for {{time_period}}" | ||
CONTENT: "Enclosed active RAHB RCN members spreadsheet of {{time_period}} for your reference." | ||
DAY_OF_MONTH: "15" | ||
HOUR_OF_DAY: "12" # 12:00 UTC is 8:00 EDT | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Run RCN Report | ||
run: python main.py --now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import os | ||
|
||
# Redash settings | ||
redash_url = os.environ.get('REDASH_URL', "https://www.example.com/redash") | ||
api_key = os.environ.get('API_KEY', "your_redash_api_key") | ||
query_ids = os.environ.get('QUERY_IDS', "1,2,3").split(',') # Converts "1,2,3" to [1, 2, 3] | ||
query_ids = [int(qid) for qid in query_ids] # Convert string IDs to integers | ||
titles = os.environ.get('TITLES', "Title 1,Title 2,Title 3").split(',') # Converts "Title 1,Title 2,Title 3" to ['Title 1', 'Title 2', 'Title 3'] | ||
|
||
logo_url = os.environ.get('LOGO_URL', "https://www.example.com/logo.png") | ||
timestamp_format = os.environ.get('TIMESTAMP_FORMAT', "%Y-%m-%d") | ||
|
||
# Email settings | ||
sendgrid_api_key = os.environ.get('SENDGRID_API_KEY', "your_sendgrid_api_key") | ||
from_email = os.environ.get('FROM_EMAIL', "[email protected]") | ||
to_emails = os.environ.get('TO_EMAILS', "[email protected],[email protected]").split(',') # Converts "[email protected],[email protected]" to ['[email protected]', '[email protected]'] | ||
subject = os.environ.get('SUBJECT', "Summary Report for {{time_period}}") | ||
content = os.environ.get('CONTENT', "Please find attached the latest summary report for {{time_period}}.") | ||
|
||
# Schedule settings | ||
day_of_month = int(os.environ.get('DAY_OF_MONTH', 15)) # Convert string to integer | ||
hour_of_day = int(os.environ.get('HOUR_OF_DAY', 16)) # Convert string to integer |