# Run every hour, on the hour. This can be customized to checking as frequently as every 5 minutes.
# Use cURL to fetch the given URL, saving the response to `data.json`
run: curl "<URL YOU WANT TO CHECK HERE>" -o data.json
# Optionally, use `jq` to pull one or more fields from the JSON to include in the SMS message
run: echo '::set-output name=someField::'$(jq -r '.someField' data.json)
# Compare the response to the previous run, using a hash of the response as the cache key
key: ${{ hashFiles('data.json') }}
# If there was not a cache hit (meaning the response changed), notify me via text message
# See https://github.com/twilio-labs/actions-sms for setup instructions
# You could use a different notification action here, so long as you include the `if` condition below
- name: Notify if data has changed
if: steps.cache.outputs.cache-hit != 'true'
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
TWILIO_API_KEY: ${{ secrets.TWILIO_API_KEY }}
TWILIO_API_SECRET: ${{ secrets.TWILIO_API_SECRET }}
fromPhoneNumber: ${{ secrets.from_phone }}
toPhoneNumber: ${{ secrets.to_phone }}
message: "There's been a change! someField is now ${{ steps.parse_data.outputs.someField }}."