This GitHub Actions workflow is designed to select random members for certain activities based on specified criteria. It runs automatically on a schedule and can also be triggered manually.
The workflow is scheduled to run every Monday at 10:42 AM (UTC) using a cron expression '42 10 * * mon'
. You can adjust the cron schedule as needed by modifying the github-actions.yml
file.
Additionally, you can manually trigger this workflow as needed. To manually trigger the workflow:
- Navigate to the "Actions" tab in your GitHub repository.
- Click on the "Pick_some_member" workflow.
- Click the "Run workflow" button.
- Provide any required input or parameters if prompted.
The workflow consists of the following steps:
-
Checkout Repository: This step checks out your GitHub repository, allowing access to your code and workflow files.
-
Setup Python: It sets up a Python environment with version 3.8.
-
Install Dependencies: Installs the
numpy
andpandas
Python packages usingpip
. Make sure you have listed these dependencies in yourpyproject.toml
orrequirements.txt
if they are required by your project. -
Run
main.py
: Executes themain.py
script, which performs various tasks related to selecting random members for activities based on criteria like last participation and eligibility. -
Create Team Sync Issue: This step creates a GitHub issue titled "Team sync" with specified details. It assigns the issue to specific users (
hafro05
andnprime496
) and adds labels (weekly sync
anddocs-team
). The issue body contains a message inviting users to contribute.
The heart of this workflow is the main.py
script. It performs the following main tasks:
- Converts a Google Sheets URL to a CSV export URL.
- Fetches member data from the Google Sheet.
- Loads and retrieves a list of emails from a CSV file.
- Assigns probabilities to emails based on exclusions.
- Selects random emails based on assigned probabilities.
- Masks email addresses for privacy.
You can further customize the logic in the main.py
script to meet your specific requirements.
To use this GitHub Actions workflow for your project:
-
Create a copy of the
github-actions.yml
file in your repository. -
Customize the cron schedule, job steps, and any other parameters to fit your project's needs.
-
Ensure that your Python code in
main.py
and any required dependencies are correctly set up and configured. -
Configure any necessary secrets or environment variables in your GitHub repository settings.
-
Trigger the workflow manually or wait for the scheduled execution to begin.
Feel free to modify and extend this workflow to suit your project's requirements.