Scrape time randomization #12
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: Scrape time randomization | |
on: | |
schedule: | |
- cron: '30 8 * * 1' # Every Monday at 8:30 UTC | |
workflow_dispatch: | |
permissions: | |
contents: write | |
actions: write | |
jobs: | |
randomize_scrape: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4.1.1 | |
with: | |
token: ${{ secrets.WORKFLOW_TOKEN }} | |
- name: Randomize scrape workflow schedule | |
run: | | |
sed -i.bak "/^\s*- cron: '/{s/\([0-9]\+\)/$(shuf -i 0-59 -n 1)/}" .github/workflows/scrape.yml | |
- name: Add and commit new CSV | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: '.github/workflows/scrape.yml' | |
message: 'Randomize scraping workflow schedule' | |
pathspec_error_handling: exitImmediately | |
push: true |