diff --git a/.github/workflows/meeting-notes.yml b/.github/workflows/meeting-notes.yml index b984317..ded0c45 100644 --- a/.github/workflows/meeting-notes.yml +++ b/.github/workflows/meeting-notes.yml @@ -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() + 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!') - name: Set output id: return-value run: |