Skip to content

Commit 6f4279f

Browse files
refactor: store file IDs as GH secrets (#595)
1 parent 6dcf46d commit 6f4279f

3 files changed

Lines changed: 6 additions & 14 deletions

File tree

.github/workflows/add_new_mentors.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name: Add Newly Accepted Mentors
33
on:
44
workflow_dispatch:
55
inputs:
6-
file_id:
7-
description: "Google Drive file ID of the Excel sheet with the new mentors data"
8-
required: true
96
current_period:
107
description: "Current period (specify \"long-term\" if during long-term mentorship registration; otherwise, default is used)"
118
required: false
@@ -45,7 +42,7 @@ jobs:
4542
4643
- name: Download spreadsheet from Google Drive
4744
run: |
48-
rclone backend copyid gdrive: ${{ github.event.inputs.file_id }} tools/samples/new_mentors.xlsx
45+
rclone backend copyid gdrive: ${{ secrets.NEW_MENTORS_FILE_ID }} tools/samples/new_mentors.xlsx
4946
5047
- name: Run scripts to append new mentors to mentors.yml and download their profile picture(s)
5148
run: |

.github/workflows/adhoc_availability_prep.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
month:
77
description: "Month number (e.g. 10 for October)"
88
required: true
9-
file_id:
10-
description: "Google Drive file ID of the Excel sheet with the availabilities"
11-
required: true
129

1310
jobs:
1411
update-mentors:
@@ -44,7 +41,7 @@ jobs:
4441
4542
- name: Download spreadsheet from Google Drive
4643
run: |
47-
rclone backend copyid gdrive: ${{ github.event.inputs.file_id }} tools/adhoc.xlsx
44+
rclone backend copyid gdrive: ${{ secrets.ADHOC_AVAILABILITIES_FILE_ID }} tools/adhoc.xlsx
4845
4946
- name: Run script
5047
run: |

tools/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ If running locally:
3030
- 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.
3131

3232
**If using GitHub Actions**, the GHA workflow is **ONLY** for adding new mentors.
33-
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.
34-
Hence, to run the GHA workflow, you only need to provide:
35-
- the file ID for the excel sheet to use
33+
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`).
34+
Hence, to run the GHA workflow, you only need to provide:
3635
- (Optional) the current period
3736

3837
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
9897
```
9998
**Note:**
10099
- If running locally, ensure to update `adhoc-prep.xslx` with the new data to be updated for the mentors.
101-
- 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.
100+
- 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`).
102101
Hence, to run the GHA workflow, you only need to provide:
103-
- the month value (e.g 9 for September) and,
104-
- the file ID for the excel sheet to use
102+
- the month value (e.g 9 for September)
105103

106104
For more information on the GC service account configurations, you can read the [README](blog_automation/README.md) in the blog automation folder.

0 commit comments

Comments
 (0)