Periodic Update #1385
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: Periodic Update | |
on: | |
schedule: | |
# Run once per day (at 1:00UTC) | |
- cron: "0 1 * * *" | |
workflow_dispatch: | |
jobs: | |
periodic-auto-update: | |
runs-on: ubuntu-latest | |
environment: token-refresh | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- run: pip install -r requirements.txt | |
- name: Run script that collects tokens | |
env: | |
ONEINCH_API_KEY: ${{ secrets.ONEINCH_API_KEY }} | |
run: | | |
python3 aggregate_tokens.py && python3 generate_readme.py | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ROLE }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Commit changes | |
if: success() | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_user_name: obvious-bot | |
commit_user_email: [email protected] | |
commit_message: Token Updates | |
- name: Upload List to S3 | |
if: success() | |
run: | | |
aws s3 sync ${{ vars.S3_SOURCE_DIR }} s3://${{ secrets.AWS_BUCKET }}/${{ vars.S3_OUTPUT_DIR }} --include "*.json" |