Poll events #26782
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: Poll events | |
| env: | |
| NODE_VERSION: 22.14.0 | |
| on: | |
| schedule: | |
| - cron: "*/30 * * * *" | |
| permissions: | |
| contents: write | |
| jobs: | |
| poll: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install package | |
| run: yarn install | |
| - name: Build package | |
| run: yarn build | |
| - name: Poll Github events | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COLLECTION_PATH: ./stats-data | |
| REPO: AdguardTeam/AdguardFilters | |
| run: yarn poll | |
| - name: commit artifacts | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| message: Events collection update | |
| default_author: github_actions | |
| notify: | |
| needs: poll | |
| # Run this job only if the previous job failed | |
| # Note: 'always()' is needed to run the notify job even if the poll job was failed | |
| if: ${{ always() && needs.poll.result == 'failure' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Send Slack notification | |
| uses: 8398a7/action-slack@v3 | |
| with: | |
| status: failure | |
| fields: workflow, repo, message, commit, author, eventName, ref, job | |
| job_name: poll | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |