From 98c5265b5d0b1296416dec3b86b2eb2a3664f487 Mon Sep 17 00:00:00 2001 From: Airah Yusuff Date: Fri, 10 Oct 2025 20:46:14 +0100 Subject: [PATCH] refactor: store file IDs as GH secrets --- .github/workflows/add_new_mentors.yml | 5 +---- .github/workflows/adhoc_availability_prep.yml | 5 +---- tools/README.md | 10 ++++------ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/add_new_mentors.yml b/.github/workflows/add_new_mentors.yml index 640ea23d..286cf575 100644 --- a/.github/workflows/add_new_mentors.yml +++ b/.github/workflows/add_new_mentors.yml @@ -3,9 +3,6 @@ name: Add Newly Accepted Mentors on: workflow_dispatch: inputs: - file_id: - description: "Google Drive file ID of the Excel sheet with the new mentors data" - required: true current_period: description: "Current period (specify \"long-term\" if during long-term mentorship registration; otherwise, default is used)" required: false @@ -45,7 +42,7 @@ jobs: - name: Download spreadsheet from Google Drive run: | - rclone backend copyid gdrive: ${{ github.event.inputs.file_id }} tools/samples/new_mentors.xlsx + rclone backend copyid gdrive: ${{ secrets.NEW_MENTORS_FILE_ID }} tools/samples/new_mentors.xlsx - name: Run scripts to append new mentors to mentors.yml and download their profile picture(s) run: | diff --git a/.github/workflows/adhoc_availability_prep.yml b/.github/workflows/adhoc_availability_prep.yml index ae6660c1..c2327c61 100644 --- a/.github/workflows/adhoc_availability_prep.yml +++ b/.github/workflows/adhoc_availability_prep.yml @@ -6,9 +6,6 @@ on: month: description: "Month number (e.g. 10 for October)" required: true - file_id: - description: "Google Drive file ID of the Excel sheet with the availabilities" - required: true jobs: update-mentors: @@ -44,7 +41,7 @@ jobs: - name: Download spreadsheet from Google Drive run: | - rclone backend copyid gdrive: ${{ github.event.inputs.file_id }} tools/adhoc.xlsx + rclone backend copyid gdrive: ${{ secrets.ADHOC_AVAILABILITIES_FILE_ID }} tools/adhoc.xlsx - name: Run script run: | diff --git a/tools/README.md b/tools/README.md index 5961bbf8..12a5c824 100644 --- a/tools/README.md +++ b/tools/README.md @@ -30,9 +30,8 @@ If running locally: - After running the script, you **HAVE** to run the [run_download_automation script](run_download_automation.sh) to download images for the new mentors. Else, the image links will be broken as they do not exist yet. Read the instructions for the download script usage below. **If using GitHub Actions**, the GHA workflow is **ONLY** for adding new mentors. -It uses a Google Cloud service account setup to retrieve the Excel file from Google Drive. The service key has been configured for womencodingcommunity Google Drive account and the file to be used/updated has been shared with the service account email. - Hence, to run the GHA workflow, you only need to provide: - - the file ID for the excel sheet to use +It uses a Google Cloud service account setup to retrieve the Excel file from Google Drive. The service key has been configured for womencodingcommunity Google Drive account and the file to be used/updated has been shared with the service account email (the ID of this file has also been saved to GitHub secrets as `NEW_MENTORS_FILE_ID`). +Hence, to run the GHA workflow, you only need to provide: - (Optional) the current period For more information on the GC service account configurations, you can read the [documentation](blog_automation/README.md) in the blog automation folder. @@ -98,9 +97,8 @@ sh run_adhoc_prep_automation.sh ``` **Note:** - If running locally, ensure to update `adhoc-prep.xslx` with the new data to be updated for the mentors. -- If using GitHub Actions, the GHA workflow for this script uses a Google Cloud service account setup to retrieve the file from Google Drive. The service key has been configured for womencodingcommunity Google Drive account and the file to be used/updated has been shared with the service account email. +- If using GitHub Actions, the GHA workflow for this script uses a Google Cloud service account setup to retrieve the file from Google Drive. The service key has been configured for womencodingcommunity Google Drive account and the file to be used/updated has been shared with the service account email (the ID of this file has also been saved to GitHub secrets as `ADHOC_AVAILABILITIES_FILE_ID`). Hence, to run the GHA workflow, you only need to provide: - - the month value (e.g 9 for September) and, - - the file ID for the excel sheet to use + - the month value (e.g 9 for September) For more information on the GC service account configurations, you can read the [README](blog_automation/README.md) in the blog automation folder.