From f00c13d303a22268115c7ab0b2adb9a6ebd98645 Mon Sep 17 00:00:00 2001 From: Vishnu KS Date: Mon, 5 Apr 2021 23:08:45 +0530 Subject: [PATCH] actions: Improve the secrets of one click release action. --- .github/workflows/update-oneclick-apps.yml | 10 +++++----- tools/oneclickapps/README.md | 9 +++------ .../prepare_digital_ocean_one_click_app_release.py | 4 ++-- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/update-oneclick-apps.yml b/.github/workflows/update-oneclick-apps.yml index 2f4116deb8..c969c0c3b7 100644 --- a/.github/workflows/update-oneclick-apps.yml +++ b/.github/workflows/update-oneclick-apps.yml @@ -9,11 +9,11 @@ jobs: - uses: actions/checkout@v2 - name: Update DigitalOcean one click app env: - DIGITALOCEAN_API_KEY: ${{ secrets.DIGITALOCEAN_API_KEY }} - ZULIP_API_KEY: ${{ secrets.ZULIP_BOT_API_KEY }} - ZULIP_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }} - ZULIP_SITE: ${{ secrets.ZULIP_ORGANIZATION_URL }} - ZULIP_STREAM_TO_SEND_BOT_MESSAGES: ${{ secrets.ZULIP_STREAM_TO_SEND_BOT_MESSAGES }} + DIGITALOCEAN_API_KEY: ${{ secrets.ONE_CLICK_ACTION_DIGITALOCEAN_API_KEY }} + ZULIP_API_KEY: ${{ secrets.ONE_CLICK_ACTION_ZULIP_BOT_API_KEY }} + ZULIP_EMAIL: ${{ secrets.ONE_CLICK_ACTION_ZULIP_BOT_EMAIL }} + ZULIP_SITE: https://chat.zulip.org + ONE_CLICK_ACTION_STREAM: kandra-ops PYTHON_DIGITALOCEAN_REQUEST_TIMEOUT_SEC: 30 RELEASE_VERSION: ${{ github.event.release.tag_name }} run: | diff --git a/tools/oneclickapps/README.md b/tools/oneclickapps/README.md index 711b12bf38..c076226e86 100644 --- a/tools/oneclickapps/README.md +++ b/tools/oneclickapps/README.md @@ -18,12 +18,9 @@ server release. You also need to set the following secrets in your GitHub repository to make the action work correctly. These secrets are passed as environment variables to the GitHub action. -* `DIGITALOCEAN_API_KEY` - DigitalOcean API KEY used for creating droplets, snapshots etc. -* `ZULIP_ORGANIZATION_URL` - The URL of the Zulip organization where the message containing - droplet/image details should be sent. -* `ZULIP_BOT_API_KEY` - The API key of the Zulip Bot used for sending messages. -* `ZULIP_STREAM_TO_SEND_BOT_MESSAGES` - The stream to which the messages should be sent. -* `ZULIP_BOT_EMAIL` - The email of the Zulip bot. +* `ONE_CLICK_ACTION_DIGITALOCEAN_API_KEY` - DigitalOcean API key used for creating droplets, snapshots etc. +* `ONE_CLICK_ACTION_ZULIP_BOT_API_KEY` - The API key of the Zulip bot used for sending messages. +* `ONE_CLICK_ACTION_ZULIP_BOT_EMAIL` - The email of the Zulip bot. Also pass the following as environment variables in `.github/workflows/update-oneclick-apps.yml`. * `PYTHON_DIGITALOCEAN_REQUEST_TIMEOUT_SEC` - This configures the maximum number of seconds diff --git a/tools/oneclickapps/prepare_digital_ocean_one_click_app_release.py b/tools/oneclickapps/prepare_digital_ocean_one_click_app_release.py index 85f74a0f66..ba3bef4ee6 100644 --- a/tools/oneclickapps/prepare_digital_ocean_one_click_app_release.py +++ b/tools/oneclickapps/prepare_digital_ocean_one_click_app_release.py @@ -122,8 +122,8 @@ def setup_one_click_app_installer(droplet: digitalocean.Droplet) -> None: def send_message(content: str) -> None: request = { "type": "stream", - "to": os.environ["ZULIP_STREAM_TO_SEND_BOT_MESSAGES"], - "topic": "DigitalOcean One Click App", + "to": os.environ["ONE_CLICK_ACTION_STREAM"], + "topic": "digitalocean installer", "content": content, } zulip_client.send_message(request)