This Python script retrieves the latest 5 tags from a specified GitHub repository, creates summaries for them, saves the
summaries in a data
directory, and sends notifications to a Slack channel (if enabled).
- Set up the
OPENAI_API_KEY
environment variable with your OpenAI API key. You can either export it in your shell or
export OPENAI_API_KEY=your_openai_api_key
add it to your .env
file:
OPENAI_API_KEY=your_openai_api_key
- If you don't have Poetry installed, install it with:
curl -sSL https://install.python-poetry.org | python3 -
or follow the installation guide: https://python-poetry.org/docs/#installation
2.Install the required dependencies using Poetry:
poetry install
- If you want to use Slack notifications, create a
.env
file in the project root directory and set theSLACK_WEBHOOK_URL
key.
- Make the
run.sh
script executable:
chmod +x run.sh
- Run the script with the GitHub username and repository name:
./run.sh <username> <repository>
If you don't want to use Slack notifications, add the --no-slack
option:
./run.sh <username> <repository> --no-slack
-
The script will save the summaries for the latest 5 tags in the
data
directory under the specified username and repository. -
You can set this script as a cron job to run every other day for more convenient use. For example, you can use the following cron entry:
0 0 */2 * * /path/to/run.sh <username> <repository>