Skip to content
Draft
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
33 changes: 17 additions & 16 deletions .github/workflows/meeting-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,30 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dateutil
if: github.event_name == 'schedule'
run: python -m pip install python-dateutil
- name: Check if we need to run this week
if: github.event_name == 'schedule'
id: check-wednesday
shell: python
run: |
import os
from datetime import datetime
from dateutil.rrule import rrule, WEEKLY, WE
today = datetime.today()
print("Today is", today)
every_two_wednesdays = rrule(WEEKLY, interval=2, dtstart=datetime(2023, 3, 15), wkst=WE)
for wednesday in every_two_wednesdays:
print("Testing if today matches...", wednesday)
if wednesday.date() == today.date():
print("Match! Job should run.")
import datetime, sys
year, week, weekday = dt.isocalendar()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
year, week, weekday = dt.isocalendar()
year, week, weekday = datetime.today().isocalendar()

You mean this, right?

print(f'{year=}, {week=}, {weekday=}')
# Wednesday is the third day of the week
not_wednesday = weekday != 3
if not_wednesday:
# exit the script
sys.exit(0)
else:
# then it's Wednesday!
print("it's Wednesday!")
if week % 2 == 0:
# conda forge meeting on even weeks
print("conda-forge meeting match! Job should run.")
with open(os.environ['GITHUB_ENV'], 'a') as f:
print("should_run=yes", f)
elif wednesday > today:
print("Didn't match. Aborting.")
break
else:
# conda community meeting on odd weeks
print('conda community meeting!')
Comment on lines +56 to +63

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I checked and we do:

  • conda-forge on even weeks
  • conda-incubator on odd weeks

So for this repo we need to reverse the logic, but for conda-forge we need to migrate it. The problem is that we have been creating the meeting notes with some days in advance now (sometimes as soon as the meeting was over), so we need to do the check not for "today" but for the next even Wednesday.

So all in all I feel that this daily logic is not serving the community needs anymore. We probably need something like:

# runs every Thursday
if week_is_even:
  date = next_even_wednesday()
  export_date_to_env()
else:
  exit 0  # do not run and wait for next week

- name: Set output
id: return-value
run: |
Expand Down