CronJob - Morhpo World Reward Claim Bot #2700
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: CronJob - Morhpo World Reward Claim Bot | |
| on: | |
| schedule: | |
| - cron: "45 * * * *" # ie. 4:45pm, 5:45pm ... etc. | |
| push: | |
| env: | |
| CHAIN_ID: 480 | |
| JSON_RPC_URL: ${{ secrets.WORLD_MAINNET_JSON_RPC_URL }} | |
| CUSTOM_RELAYER_PRIVATE_KEY: ${{ secrets.CUSTOM_RELAYER_PRIVATE_KEY }} | |
| NODE_OPTIONS: "--max_old_space_size=32768" | |
| permissions: write-all | |
| jobs: | |
| runCLI: | |
| name: Morpho World Reward Claim Bot | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| max-parallel: 1 | |
| matrix: | |
| node: ["22.18.0"] | |
| os: [ubuntu-latest] | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Use Node ${{ matrix.node }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: NPM Install | |
| run: npm install | |
| - name: Store current date | |
| id: date | |
| run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV" | |
| - name: Store current time | |
| id: time | |
| run: echo "time=$(date +'%H-%M-%S_%Z')" >> "$GITHUB_ENV" | |
| - name: Run claim | |
| id: runClaim | |
| run: node run-claim.js | |
| - name: Comment Error | |
| id: commentError | |
| if: steps.runClaim.outputs.exitcode == 1 | |
| uses: actions/github-script@v5 | |
| continue-on-error: true | |
| with: | |
| script: | | |
| await github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: `Liquidator bot failed for run at "$date"__"$time": Exit Code 1` | |
| }) |