Fetch Currency Rates (against USD, hourly) #12261
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Fetch Currency Rates (against USD, hourly) | |
on: | |
schedule: | |
- cron: "0 * * * *" | |
env: | |
API_KEY: ${{ secrets.CURRENCY_BEACON_API_KEY }} | |
jobs: | |
run_script: | |
name: Run fetch-rates.sh | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Run script | |
run: | | |
chmod +x fetch-rates.sh | |
./fetch-rates.sh | |
- name: Commit files | |
run: | | |
timestamp=$(date "+%Y-%m-%d %H:%M:%S") | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
git add . | |
git commit -m "๐๏ธ updated currency-rates.json ($timestamp)" -a | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |