Skip to content

Observe Contract

Observe Contract #9

Workflow file for this run

name: Observe Contract
on:
workflow_dispatch:
schedule:
- cron: '0 * * * *' # every hour
jobs:
observe:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Check out repository code
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version-file: '.nvmrc'
- name: Install
run: yarn
- name: Observe
run: |
node tools/observe.js --silent > output.log 2>&1 || exit 1
continue-on-error: true
- name: Read observation results
id: read-log
run: echo "::set-output name=log::$(cat output.log)"
# Failure notification
- name: Send Slack failure notification
if: failure()
env:
SLACK_TITLE: IO/AO Contract Observation failed!
SLACK_COLOR: danger
SLACK_MESSAGE: 'Observation failed! Logs: ${{ steps.read-log.outputs.log }}'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: rtCamp/action-slack-notify@v2
# Success notification
- name: Send Slack success notification
if: success()
env:
SLACK_TITLE: IO/AO Contract Observation succeeded!
SLACK_COLOR: good
SLACK_MESSAGE: 'Observation succeeded! Logs: ${{ steps.read-log.outputs.log }}'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: rtCamp/action-slack-notify@v2