|
1 | 1 | # The only workflow that calls the real API. Needs the BRIGHTDATA_API_TOKEN |
2 | 2 | # secret and spends about one credit per post. |
3 | 3 | # |
4 | | -# Three ways it runs: |
| 4 | +# Four ways it runs: |
| 5 | +# on every push to main: one post from nasa and the README's links, one |
| 6 | +# credit and about three minutes, so a broken commit shows up at once. |
| 7 | +# A newer push cancels a run still going for an older commit. |
5 | 8 | # by hand, from the Actions tab, to scrape whatever accounts you choose |
6 | 9 | # every day at 06:00 UTC except Monday: one post from nasa, the async |
7 | 10 | # path, and the field table, about two credits |
8 | 11 | # every Monday at 06:00 UTC: the same, plus every code block in the README, |
9 | | -# about 37 credits and 30 minutes |
| 12 | +# about 35 credits and 30 minutes |
10 | 13 | # |
11 | | -# Not on push: that would spend money per commit, and a slow day at the API |
12 | | -# would show up as a failed build on your repository. |
| 14 | +# A slow day at the API shows up as a red run. Rerun it before reading more |
| 15 | +# into it. |
13 | 16 | name: Live check |
14 | 17 |
|
15 | | -run-name: "${{ github.event.schedule == '0 6 * * 1' && 'Weekly check: does every README block still work?' || github.event_name == 'schedule' && 'Daily check: is anything broken?' || format('Scrape {0}, {1} posts each', inputs.handles, inputs.limit) }}" |
| 18 | +run-name: "${{ github.event.schedule == '0 6 * * 1' && 'Weekly check: does every README block still work?' || github.event_name == 'schedule' && 'Daily check: is anything broken?' || github.event_name == 'push' && format('Push check: {0}', github.event.head_commit.message) || format('Scrape {0}, {1} posts each', inputs.handles, inputs.limit) }}" |
16 | 19 |
|
17 | 20 | on: |
| 21 | + push: |
| 22 | + branches: [main] |
18 | 23 | schedule: |
19 | 24 | - cron: "0 6 * * 0,2-6" # daily smoke, every day except Monday |
20 | 25 | - cron: "0 6 * * 1" # Monday: the whole README |
|
37 | 42 | permissions: |
38 | 43 | contents: write # the daily check commits the regenerated field table |
39 | 44 |
|
| 45 | +concurrency: |
| 46 | + group: live-${{ github.event_name }}-${{ github.ref }} |
| 47 | + cancel-in-progress: ${{ github.event_name == 'push' }} # only the newest commit matters |
| 48 | + |
40 | 49 | jobs: |
41 | 50 | scrape: |
42 | 51 | name: Fetch the posts and attach them to this run |
|
0 commit comments