Daily Checks #310
This file contains hidden or 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: Daily Checks | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * *" # Every day at midnight UTC | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash --noprofile --norc -euo pipefail {0} | |
| jobs: | |
| checks: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Check diff for reward weights | |
| id: diff-reward-weights | |
| if: success() || failure() # Run this step even if one of the previous steps failed | |
| run: | | |
| result=$(scripts/diff-reward-weights.sh) && exit_code=$? || exit_code=$? | |
| echo "$result" | |
| { | |
| echo '```' | |
| echo "$result" | |
| echo '```' | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| exit "$exit_code" | |
| - name: Post reward weights check results to a Slack channel | |
| if: failure() && steps.diff-reward-weights.outcome == 'failure' | |
| uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0 | |
| with: | |
| method: chat.postMessage | |
| token: ${{ secrets.SLACK_BOT_TOKEN }} | |
| payload: | | |
| channel: ${{ secrets.SLACK_CHANNEL_ID_SUPERVALIDATOR_OPERATIONS }} | |
| markdown_text: ":warning: One more more configuration checks failed. Please check the [logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details." | |
| - name: Get missing voters | |
| id: get-missing-voters | |
| if: success() || failure() # Run this step even if one of the previous steps failed | |
| run: | | |
| result=$(scripts/get-missing-voters.sh 1) && exit_code=$? || exit_code=$? | |
| echo "$result" | |
| { | |
| echo '```' | |
| echo "$result" | |
| echo '```' | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| { | |
| echo "slack_message<<EOF" | |
| echo ":warning: $result" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| exit "$exit_code" | |
| - name: Post missing voters check results to a Slack channel | |
| if: failure() && steps.get-missing-voters.outcome == 'failure' | |
| uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0 | |
| with: | |
| method: chat.postMessage | |
| token: ${{ secrets.SLACK_BOT_TOKEN }} | |
| payload: | | |
| channel: ${{ secrets.SLACK_CHANNEL_ID_SUPERVALIDATOR_OPERATIONS }} | |
| markdown_text: ${{ toJSON(steps.get-missing-voters.outputs.slack_message) }} |