Wire up the call to the endpoint #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Calypso Channel Status | ||
run-name: ${{ github.actor }} Checking Calypso Slack Channel Status | ||
on: [push] | ||
jobs: | ||
CheckCalypsoChannelStatus: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | ||
STATUS=$(curl -s https://public-api.wordpress.com/rest/v1.1/internal/calypso-slack-channel) | ||
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 |