Cron Job Validation #4429
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: Cron Job Validation | |
on: | |
schedule: | |
- cron: "0 * * * *" | |
jobs: | |
validation: | |
name: Suggest Chain Validation Check | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup nodejs | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- run: npm install --global yarn | |
- run: yarn install --frozen-lockfile | |
- name: Check chain updates | |
id: check-update | |
continue-on-error: true | |
run: | | |
yarn ts-node src/schedule.ts | |
env: | |
PRICE_URL: ${{ secrets.PRICE_URL }} | |
- name: Slack Alert Notification | |
uses: slackapi/[email protected] | |
if: ${{ steps.check-update.outputs.hasError }} | |
with: | |
channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | |
payload: | | |
{ | |
"text": "Suggest Chain Alert", | |
"attachments": [ | |
{ | |
"color": "FB486C", | |
"fields": [ | |
{ | |
"title": "Error Message", | |
"short": false, | |
"value": "${{ steps.check-update.outputs.errorMessage }}" | |
} | |
] | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |