Skip to content

Commit

Permalink
MT Staging Telegram variables (#701)
Browse files Browse the repository at this point in the history
* Telegram variables

* add mt step
  • Loading branch information
sinehome authored Oct 17, 2024
1 parent a33dd04 commit 728a697
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/actions/custom-actions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ runs:
- name: Kellimni Malta Production release custom action
if: inputs.helpline-name == format('MT_PROD')
uses: ./.github/actions/custom-actions/kellimni_production_custom
- name: Kellimni Malta Staging release custom action
if: inputs.helpline-name == format('MT_STG')
uses: ./.github/actions/custom-actions/kellimni_staging_custom
with:
account-sid: ${{ inputs.account-sid }}
- name: Zambia Staging release custom action
if: inputs.helpline-name == format('ZM_STG')
uses: ./.github/actions/custom-actions/zambia_staging_custom
Expand Down
58 changes: 58 additions & 0 deletions .github/actions/custom-actions/kellimni_staging_custom/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright (C) 2021-2023 Technology Matters
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see https://www.gnu.org/licenses/.

name: 'Kellimni MT Staging release custom action'
description: 'Sets up environment variables related to non-standard additional features in use in the beta environment'
runs:
using: "composite"
steps:
# Telegram environment variables
- name: Set Telegram Flex Bot Token
uses: "marvinpinto/action-inject-ssm-secrets@latest"
with:
ssm_parameter: "/staging/telegram/${{inputs.account-sid}}/flex_bot_token"
env_variable_name: "TELEGRAM_FLEX_BOT_TOKEN"
- name: Set Telegram Bot Api Secret Token
uses: "marvinpinto/action-inject-ssm-secrets@latest"
with:
ssm_parameter: "/staging/telegram/${{inputs.account-sid}}/bot_api_secret_token"
env_variable_name: "TELEGRAM_BOT_API_SECRET_TOKEN"
- name: Set helpline Telegram Studio Flow SID
uses: "marvinpinto/action-inject-ssm-secrets@latest"
with:
ssm_parameter: "/staging/twilio/${{inputs.account-sid}}/telegram_studio_flow_sid"
env_variable_name: "TELEGRAM_STUDIO_FLOW_SID"
- name: Set helpline serverless URL
uses: "marvinpinto/action-inject-ssm-secrets@latest"
with:
ssm_parameter: "/staging/serverless/${{inputs.account-sid}}/base_url"
env_variable_name: "SERVERLESS_BASE_URL"
- name: Set Telegram flex bot webhook
shell: bash
run: |
curl --request POST \
--header "Content-Type: application/json" \
--url "https://api.telegram.org/bot${{ env.TELEGRAM_FLEX_BOT_TOKEN }}/setWebhook" \
--data '{ "url": "${{ env.SERVERLESS_BASE_URL }}/webhooks/telegram/TelegramToFlex", "secret_token": "${{ env.TELEGRAM_BOT_API_SECRET_TOKEN }}" }'
# Append environment variables
- name: Add TELEGRAM_FLEX_BOT_TOKEN
run: echo "TELEGRAM_FLEX_BOT_TOKEN=${{ env.TELEGRAM_FLEX_BOT_TOKEN }}" >> .env
shell: bash
- name: Add TELEGRAM_BOT_API_SECRET_TOKEN
run: echo "TELEGRAM_BOT_API_SECRET_TOKEN=${{ env.TELEGRAM_BOT_API_SECRET_TOKEN }}" >> .env
shell: bash
- name: Add TELEGRAM_STUDIO_FLOW_SID
run: echo "TELEGRAM_STUDIO_FLOW_SID=${{ env.TELEGRAM_STUDIO_FLOW_SID }}" >> .env
shell: bash

0 comments on commit 728a697

Please sign in to comment.