https://github.com/panoschatzi/yen_rate_automation
Automated checking and reporting of JPY to EUR exchange rate using GitHub Actions.
https://github.com/panoschatzi/yen_rate_automation
api automation github-actions httr r
Last synced: 19 days ago
JSON representation
Automated checking and reporting of JPY to EUR exchange rate using GitHub Actions.
- Host: GitHub
- URL: https://github.com/panoschatzi/yen_rate_automation
- Owner: PanosChatzi
- License: mit
- Created: 2025-02-03T10:25:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-10T20:21:21.000Z (over 1 year ago)
- Last Synced: 2025-10-19T19:50:26.066Z (8 months ago)
- Topics: api, automation, github-actions, httr, r
- Language: R
- Homepage:
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JPY to EUR Exchange Rate Checker
This GitHub Actions workflow fetches the latest **JPY to EUR exchange rate** every **Monday at midnight (UTC)** and sends an **email notification** if the rate falls below a specified threshold.
## 🚀 How It Works
1. Fetches the **JPY to EUR exchange rate** from [ExchangeRate-API](https://www.exchangerate-api.com/).
2. Logs the exchange rate and compares it to the previous value.
3. Sends an **email alert** if the rate is below the set threshold.
## 🛠 Setup Instructions
### 1️⃣ **Add Secrets to GitHub**
Go to **Settings → Secrets and variables → Actions → New repository secret**, and add:
| Secret Name | Description |
|---------------------|-------------|
| `EXCHANGE_API_KEY` | API key for exchange rate service (if needed) |
| `SMTP_USER` | Your SMTP email address |
| `SMTP_PASSWORD` | Your SMTP email password (or app password) |
| `SMTP_SERVER` | SMTP server address (e.g., `smtp.gmail.com`) |
| `SMTP_PORT` | SMTP port (e.g., `587` for TLS) |
| `RECIPIENT_EMAIL` | The email address to receive alerts |
| `PRICE_THRESHOLD` | The exchange rate threshold for alerts (e.g., `0.0065`) |
---
### 3️⃣ **Manually Trigger the Workflow**
You can also **run the workflow manually**:
1. Go to **Actions** in your GitHub repository.
2. Select **Weekly JPY to EUR Rate Check**.
3. Click **Run workflow**.
---
## 🔧 Dependencies
The R script requires:
- `httr`
- `jsonlite`
- `emayili`
These are automatically installed when the workflow runs.
---
## 📄 Logs & Debugging
- Exchange rates are logged in `exchange_rate_log.txt`.
- To debug, check the **GitHub Actions logs** under **Actions → Workflow Runs**.
---
## 📧 Email Notifications
- If the exchange rate **falls below the threshold**, an email is sent.
- The email includes the **current rate** and **percentage change** from the last logged value.
---
## 🏆 Future Improvements
- ✅ Add more exchange rate APIs for redundancy.
- ✅ Improve email formatting.
- 🗄 Store logs in a more structured format (e.g., CSV or database).
---
### 🌟 License
This project is **open-source** under the [MIT License](LICENSE).