Skip to content

Check CODA VM

Check CODA VM #23

Workflow file for this run

name: Check CODA VM
on:
workflow_dispatch:
schedule:
# 6 AM UTC or 1 AM EST
- cron: 0 6 * * *
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: check issue body
run: |
export TODAY=`date +'%m/%d/%Y'`
echo $TODAY
BODY=`curl -s -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.MY_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/GuidesBot/dependCheckForGuides/issues/876 \
| grep body | awk -F '"' '/body/ {print $4}'`
echo $BODY
if [ $TODAY = $BODY ]; then
echo "CODA VM is running"
else
echo "CODA VM is not running"
MESSAGE='{"body":"@gkwan-ibm and @Ruilin-Ma, CODA VM is down on '$TODAY'!"}'
echo "$MESSAGE"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.MY_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/GuidesBot/dependCheckForGuides/issues/876/comments \
-d "$MESSAGE"
fi