Workflow to archive an AirTable base as CSVs in a git repository, as well as
downloading any files attached to tables. Uses phantomjs
to
collect information about the base schema in order to download all tables.
The following environement variables are needed:
DATA_REPO_URL
- The remote git repo you want to store data in. If using GitHub, something likehttps://USER:[email protected]/user/repo
will make it easy to automate the script, but it's not super secure. Otherwise credentials should be set by using an SSH git URL and and local keysAT_BASE
- The AirTable base to pull from. This is of the formappXXXXXXXXXX
, and is found in the URL of the API of your AirTable, e.g.,https://airtable.com/appXXXXXXXXXX/api/docs
.AIRTABLE_LOGIN_EMAIL
- Your user account email = Sys.getenv("AIRTABLE_LOGIN_EMAIL") #airtable creds. Note that AIRTABLE_API_KEY is also needed in the environmentAIRTABLE_LOGIN_PWD
- Your Airtable user account passwordAIRTABLE_API_KEY
- Your AirTable API key.GIT_USER
- The git user name to sign automated commits withGIT_EMAIL
- The git user email to sign automated commits with