From 87bad068e11bf0f4db55fb1e7932f6773dcdd58f Mon Sep 17 00:00:00 2001 From: Maaike Date: Fri, 8 May 2026 11:24:37 +0200 Subject: [PATCH] Remove current GISC watch workflow and associated script --- .github/workflows/current-gisc-watch.yml | 43 ------------------------ scripts/generate-current-gisc-watch.py | 16 --------- 2 files changed, 59 deletions(-) delete mode 100644 .github/workflows/current-gisc-watch.yml delete mode 100644 scripts/generate-current-gisc-watch.py diff --git a/.github/workflows/current-gisc-watch.yml b/.github/workflows/current-gisc-watch.yml deleted file mode 100644 index 79def64..0000000 --- a/.github/workflows/current-gisc-watch.yml +++ /dev/null @@ -1,43 +0,0 @@ -# Workflow to generate current-gisc-watch.txt and publish to github-pages -name: Update Current GISC Watch - -on: - schedule: - - cron: '0 0 * * *' # Runs daily at midnight UTC - push: - branches: - - main - - add-gisc-watch-roster - -permissions: - contents: write # Required to push to gh-pages - -jobs: - update-current-gisc-watch: - name: Update current-gisc-watch.txt - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Needed to access all branches - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: Generate current-gisc-watch.txt - run: python3 scripts/generate-current-gisc-watch.py - - - name: Commit and push to gh-pages - run: | - git config --global user.email "wis2-support@wmo.int" - git config --global user.name "wis2-operation GHA" - git checkout gh-pages - echo "Updating current-gisc-watch.txt with contents:" - cat current-gisc-watch.txt - git add current-gisc-watch.txt - git commit -m "update current-gisc-watch.txt" || echo "No changes to commit" - git push origin gh-pages - diff --git a/scripts/generate-current-gisc-watch.py b/scripts/generate-current-gisc-watch.py deleted file mode 100644 index caaef05..0000000 --- a/scripts/generate-current-gisc-watch.py +++ /dev/null @@ -1,16 +0,0 @@ -import csv -from datetime import datetime - -input_file = 'gisc-watch-roster.csv' -output_file = 'current-gisc-watch.txt' -today = datetime.utcnow().date() - -with open(input_file, newline='', encoding='utf-8') as csvfile: - reader = csv.DictReader(csvfile) - names = [row['gisc_name'] for row in reader - if row.get('start_date') and row.get('end_date') - and datetime.strptime(row['start_date'], '%Y-%m-%d').date() <= today <= datetime.strptime(row['end_date'], '%Y-%m-%d').date()] - -with open(output_file, 'w', encoding='utf-8') as f: - for name in names: - f.write(f"{name}\n") \ No newline at end of file