-
Notifications
You must be signed in to change notification settings - Fork 50
Improve Automation for adding new mentors #587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
khairahscorner
merged 10 commits into
Women-Coding-Community:main
from
khairahscorner:improve_automations_for_adding_new_mentors
Oct 10, 2025
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3d41511
xlsx file should include num_mentees column data
khairahscorner e7a6058
ensure new mentors use the correct sort depending on the cycle timeline
khairahscorner 76fb565
update download image script + remove TODO that could cause errors if…
khairahscorner 7469820
update README with important details on running each script
khairahscorner 6836b02
update download_image script to use excel file and download images fo…
khairahscorner dd3d3a5
add new workflow for adding new mentors
khairahscorner f064572
fix: sheet names should match usage in script
khairahscorner 67fe088
Merge branch 'Women-Coding-Community:main' into improve_automations_f…
khairahscorner d3d491c
cleanups + updates
khairahscorner e5003c8
update test to reflect additional sample mentor added to sheet
khairahscorner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| 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 | ||
| default: 'default' | ||
|
|
||
| jobs: | ||
| add-new-mentors: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Cache pip | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/pip | ||
| key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements.txt') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pip- | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r tools/requirements.txt | ||
|
|
||
| - name: Install and Configure rclone with Google Cloud service account | ||
| run: | | ||
| curl https://rclone.org/install.sh | sudo bash | ||
| echo '${{ secrets.GOOGLECLOUD_SERVICE_KEY_RETRIEVE_ADHOC_FILE_JSON }}' > service_account.json | ||
| rclone config create gdrive drive scope=drive service_account_file=service_account.json | ||
|
|
||
| - name: Download spreadsheet from Google Drive | ||
| run: | | ||
| rclone backend copyid gdrive: ${{ github.event.inputs.file_id }} tools/samples/new_mentors.xlsx | ||
|
|
||
| - name: Run scripts to append new mentors to mentors.yml and download their profile picture(s) | ||
| run: | | ||
| cd tools | ||
| python3 automation_mentors.py samples/new_mentors.xlsx ../_data/mentors.yml ${{ github.event.inputs.current_period }} a 0 | ||
| python3 download_image.py samples/new_mentors.xlsx | ||
|
|
||
| - name: Cleanup files | ||
| if: always() | ||
| run: rm -f service_account.json tools/samples/new_mentors.xlsx | ||
|
|
||
| - name: Create or Update Pull Request | ||
| uses: peter-evans/create-pull-request@v7 | ||
| with: | ||
| token: ${{ secrets.GHA_ACTIONS_ALLOW_TOKEN }} | ||
| commit-message: "added new mentors" | ||
| branch: "automation/add-new-mentors" | ||
| team-reviewers: | | ||
| Women-Coding-Community/leaders | ||
| title: "[WCC Bot] Add New Mentors" | ||
| body: | | ||
| This PR was created automatically by a GitHub Action that handles adding new mentors. | ||
| `_data/mentors.yml` should be updated with the new data. Images for the new mentors should also have been downloaded and included in this PR. | ||
|
|
||
| Please review the changes and ensure that the changes are as expected before merging. | ||
| labels: | | ||
| automation | ||
| new-mentors | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.