An open API service indexing awesome lists of open source software.

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.

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).