diff --git a/.github/workflows/socrata_upload.yaml b/.github/workflows/socrata_upload.yaml index acd674e27..6f04e213e 100644 --- a/.github/workflows/socrata_upload.yaml +++ b/.github/workflows/socrata_upload.yaml @@ -27,7 +27,7 @@ on: # We use these schedules to determine the value of the `UPLOAD_SCHEDULE` # env var below, so make sure to change that env var definition if you # change any of these schedules. - # + # # Run a monthly job on the first of every month at 11am UTC (6am UTC-5). - cron: '0 11 1 * *' # Run a semi-monthly job on the fifteenth of every month at 11am UTC (6am UTC-5). @@ -92,7 +92,7 @@ jobs: # These cron expressions are shared by the `on.schedule` workflow # attribute defined above, so make sure to change that attribute # definition alongside any changes you make here - UPLOAD_SCHEDULE: > + UPLOAD_SCHEDULE: >- ${{ github.event.schedule == '0 11 1 * *' && 'monthly' || github.event.schedule == '0 11 15 * *' && 'semimonthly' || '' }} run: python ./socrata/socrata_upload.py diff --git a/socrata/socrata_upload.py b/socrata/socrata_upload.py index 0932c9e01..dec34682b 100644 --- a/socrata/socrata_upload.py +++ b/socrata/socrata_upload.py @@ -491,7 +491,13 @@ def socrata_upload(asset_info, overwrite=False, years=None): if __name__ == "__main__": - print(f"Running upload for event type: {os.getenv('WORKFLOW_EVENT_NAME')}") + event_type = " ".join( + filter( + None, + [os.getenv("UPLOAD_SCHEDULE"), os.getenv("WORKFLOW_EVENT_NAME")], + ) + ) + print(f"Running upload for event type: {event_type}") # Retrieve asset(s) all_assets = parse_assets(os.getenv("SOCRATA_ASSET"))