diff --git a/.github/workflows/is-calypso-channel-green.yml b/.github/workflows/is-calypso-channel-green.yml new file mode 100644 index 0000000000000..f3ce4d719a818 --- /dev/null +++ b/.github/workflows/is-calypso-channel-green.yml @@ -0,0 +1,23 @@ +name: Is Calypso Channel Green? +run-name: ${{ github.actor }} Checking Calypso Slack Channel Status + +on: + merge_group: + +jobs: + check-channel-status: + runs-on: ubuntu-latest + steps: + - run: | + STATUS=$(curl -s https://public-api.wordpress.com/wpcom/v2/calypso-slack-channel-status --header "Authorization: ${{ secrets.CALYPSO_CHANNEL_STATUS_API_SECRET }}" | xargs) + if [ "$STATUS" = "GREEN" ]; then + echo "Calypso Slack channel is green." + exit 0 + elif [ "$STATUS" = "RED" ]; then + echo "Calypso Slack channel is red." + exit 1 + else + echo "Calypso Slack channel status is unknown." + exit 1 + fi + shell: bash \ No newline at end of file