This repository contains GitHub Actions workflows that fetch inbound message attachmnets data from Turn API and sync the data to GCP storage bucket.
The sync runs daily and the code fetches data for the past 2 days.
-
Set up uv for managing dependencies.
- Install uv according to instructions here.
- Install python using
uv python install. - Sync the project's dependencies using
uv sync. - Add and remove dependencies using
uv add package_nameanduv remove package_name. - Run python scripts using
uv run path_to_script.py.
-
Configure the repository secrets locally.
- Create a file secrets/slack_token.txt that contains the Slack bot token.
- Create a file secrets/service_account_key_raw.json that contains the JSON key for the service account that will dump the data to the storage buckets (airbyte-user). Ensure that this has 'Storage Object User' permission on the dev and prod buckets.
- Create a file secrets/service_account_key_analytics.json that contains the JSON key for the service account that will connect to BigQuery (metabase-user).
- Create a file secrets/turn_auth.json that contains the JSON key for the API headers used by turn for each line (available on passbolt).
-
Configure the repository secrets on GitHub.
- Copy and paste the contents of secrets/slack_token.txt into a secret named "SLACK_TOKEN".
- Copy and paste the contents of secrets/service_account_key_raw.json into a secret named "SERVICE_ACCOUNT_KEY_RAW".
- Copy and paste the contents of secrets/service_account_key_analytics.json into a secret named "SERVICE_ACCOUNT_KEY_ANALYTICS".
- Copy and paste the contents of secrets/turn_auth.json into a secret named "TURN_HEADERS".