This demo is part of a larger Flat Data project created by GitHub OCTO. Read more about the project here.
This repository uses a Flat Data Action to query a SQL database with flight data and downloads the data as a CSV file every day at 6am UTC. A SQL connection string has to be added to the GitHub repository as a secret.
Inside .github/workflows/flat.yaml
:
- name: Fetch data
uses: githubocto/flat@v3
with:
sql_connstring: ${{ secrets.CONNSTRING }} # a SQL database connection string fetched as a GitHub secret
sql_queryfile: query.sql # a file with the SQL query
downloaded_filename: sql-data.csv # should be a csv or json