Skip to content

Commit be8663c

Browse files
committed
Live check runs on every push to main: the one-credit smoke, newest commit wins
1 parent 0531872 commit be8663c

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

‎.github/workflows/live.yml‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
# The only workflow that calls the real API. Needs the BRIGHTDATA_API_TOKEN
22
# secret and spends about one credit per post.
33
#
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.
58
# by hand, from the Actions tab, to scrape whatever accounts you choose
69
# every day at 06:00 UTC except Monday: one post from nasa, the async
710
# path, and the field table, about two credits
811
# 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
1013
#
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.
1316
name: Live check
1417

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) }}"
1619

1720
on:
21+
push:
22+
branches: [main]
1823
schedule:
1924
- cron: "0 6 * * 0,2-6" # daily smoke, every day except Monday
2025
- cron: "0 6 * * 1" # Monday: the whole README
@@ -37,6 +42,10 @@ on:
3742
permissions:
3843
contents: write # the daily check commits the regenerated field table
3944

45+
concurrency:
46+
group: live-${{ github.event_name }}-${{ github.ref }}
47+
cancel-in-progress: ${{ github.event_name == 'push' }} # only the newest commit matters
48+
4049
jobs:
4150
scrape:
4251
name: Fetch the posts and attach them to this run

0 commit comments

Comments
 (0)