This is a project designed to test and demonstrate GitHub Actions functionality. It implements an automated weather monitoring system that weekly fetches weather information for Taipei and logs it to a file.
- Automated Execution: Weekly automated runs using GitHub Actions
- Weather Monitoring: Fetches weather information for Taipei
- Logging: Automatic logging of execution results and weather data
- Auto-commit: Automatically commits updated log files to the repository
- Python 3.12
- GitHub Actions
- requests library (for API requests)
- logging module (for log management)
- Clone the repository:
git clone [your-repository-url]- Set up virtual environment:
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
.\venv\Scripts\activate # Windows- Install dependencies:
pip install -r requirements.txtThis project includes a GitHub Actions workflow configured in .github/workflows/actions.yml:
- Automatically runs at 00:00 every day
- Uses Ubuntu latest as the runtime environment
- Automatically installs Python 3.12
- Automatically installs required dependencies
- Executes the
trigger_test.pyscript - Automatically commits updated log files
The following environment variables need to be set in your GitHub repository's Settings > Secrets:
SOME_SECRET: Secret key for testing purposes
- Log files are saved in
status.log - Uses RotatingFileHandler for log rotation
- Maximum file size: 1MB
- Keeps 1 backup file
- Local Testing:
python trigger_test.py- Automated Execution:
- No manual intervention required, GitHub Actions will execute automatically
- Execution results can be viewed in the Actions tab
- Ensure GitHub Secrets are properly configured
- Set up corresponding environment variables for local testing
- Log files will be automatically committed to the repository