Version: 1.1.1
This repository is a collection of GitHub Actions for automated operations related to Twilio Studio Flows. The prerequisites to these actions are:
- Studio Flow Definitions are stored as JSON files in the repository
- A Studio Configuration file is populated
Every actions require a Studio Configuration file to be populated according to the JSON schema.
You can get autocomplete in your IDE by setting the $schema
variable in your file:
{
"$schema": "https://raw.githubusercontent.com/zingdevlimited/studio-flow-actions/v1/config-schema.json",
"flows": [],
"replaceWidgetTypes": []
}
This action will:
- Download the latest Flow Definition of every Studio Flow referenced in the Studio Configuration
- Commit the updated definitions to the configured JSON file paths
- Opens a Pull Request with these changes
This is used to avoid common merge and overwrite issues when developers work with Studio Flow simultaneously. It also discourages updating the Flow Definitions outside of the Studio editor.
permissions:
contents: write
pull-requests: write
jobs:
sync:
runs-on: ubuntu-22.04
steps:
- name: Sync Flows
uses: zingdevlimited/studio-flow-actions/sync@v1
with:
CONFIG_PATH: studioconfig.json
ADD_MISSING_DEPLOY_PROPERTIES: true
TWILIO_API_KEY: ${{ vars.TWILIO_API_KEY }}
TWILIO_API_SECRET: ${{ secrets.TWILIO_API_SECRET }}
This action will:
- Parse every Flow Definition file referenced in the Studio Configuration
- Ensure the syntax is valid and any properties required for the Deploy action are present
Note that this is an offline check and therefore does not use Twilio Credentials
jobs:
check:
runs-on: ubuntu-22.04
steps:
- name: Check Flows
uses: zingdevlimited/studio-flow-actions/check@v1
with:
CONFIG_PATH: studioconfig.json
This action will:
- Parse every Flow Definition file referenced in the Studio Configuration
- Validate all referenced Twilio resources exist
- Replace all account-specific values in the Flow Definition JSONs
- Use the Flow Validate API to ensure the Flow Definitions are valid
jobs:
validate:
runs-on: ubuntu-22.04
steps:
- name: Validate Flows
uses: zingdevlimited/studio-flow-actions/validate@v1
with:
CONFIG_PATH: studioconfig.json
TWILIO_API_KEY: ${{ vars.TWILIO_API_KEY }}
TWILIO_API_SECRET: ${{ secrets.TWILIO_API_SECRET }}
env:
ASSETS_BASE_URL: https://myassets-1234.twil.io
This action will:
- Parse every Flow Definition file referenced in the Studio Configuration
- Replace all account-specific values in the Flow Definition JSONs
- Create/Update the Studio Flows in the account specified
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- name: Deploy Flows
uses: zingdevlimited/studio-flow-actions/deploy@v1
with:
CONFIG_PATH: studioconfig.json
TWILIO_API_KEY: ${{ vars.TWILIO_API_KEY }}
TWILIO_API_SECRET: ${{ secrets.TWILIO_API_SECRET }}
env:
ASSETS_BASE_URL: https://myassets-1234.twil.io
See Alternate Runners for ways to run this program outside of GitHub actions.