From a03f06deecfbe76856476125d429dfed90c44125 Mon Sep 17 00:00:00 2001
From: Jover Lee <joverlee521@gmail.com>
Date: Wed, 15 Nov 2023 14:08:38 -0800
Subject: [PATCH] fetch-and-ingest-branch: Send Slack notications to test
 channel

This change was motivated by the unintentional bug introduced in
https://github.com/nextstrain/mpox/pull/222 that would only be triggered
by using Slack notifications. This allows to test branches and send
notifications to the testing channel.

As part of this change, I've added an organization level variable
`TEST_SLACK_CHANNEL` that points our #scratch channel for testing
Slack notifications.
---
 .github/workflows/fetch-and-ingest-branch.yaml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/fetch-and-ingest-branch.yaml b/.github/workflows/fetch-and-ingest-branch.yaml
index 5bf3e1b6..eabaf6e1 100644
--- a/.github/workflows/fetch-and-ingest-branch.yaml
+++ b/.github/workflows/fetch-and-ingest-branch.yaml
@@ -34,6 +34,8 @@ jobs:
       runtime: aws-batch
       env: |
         NEXTSTRAIN_DOCKER_IMAGE: ${{ inputs.image }}
+        GITHUB_RUN_ID: ${{ github.run_id }}
+        SLACK_CHANNELS: ${{ vars.TEST_SLACK_CHANNEL }}
         UPLOAD_CONFIG: ${{ needs.set_config_overrides.outputs.upload_config }}
       run: |
         nextstrain build \
@@ -44,6 +46,9 @@ jobs:
           --memory 64gib \
           --env AWS_ACCESS_KEY_ID \
           --env AWS_SECRET_ACCESS_KEY \
+          --env GITHUB_RUN_ID \
+          --env SLACK_TOKEN \
+          --env SLACK_CHANNELS \
           ingest \
             --configfiles config/config.yaml config/optional.yaml \
-            --config trigger_rebuild=False send_slack_notifications=False upload="$UPLOAD_CONFIG"
+            --config trigger_rebuild=False send_slack_notifications=True upload="$UPLOAD_CONFIG"