Contents Lesson 2 of 7

8 min read · practitioner

A schedule, not a tab: GitHub Actions and the market close

By the end of this lesson you will have .github/workflows/alert.yml, a workflow that runs your alert every weekday at 17:30 New York time and whenever you ask, and one green run of it, in mock mode, for zero calls.

What you will see: the Actions tab listing Alert with a Run workflow button, and a run whose log shows the price line, each bar's date and your FIRED line.

The idea: a clock that is not your laptop

A page runs while open and a laptop while awake; the alert needs a clock of its own.

GitHub Actions is the main path: your repository is already there, there is no server to keep, and standard GitHub-hosted runners are free in a public repository. A private one draws on your account's included usage; read GitHub's billing page first.

The alternative is your host's cron. Vercel's, in vercel.json, calls a route of a deployed app: always UTC, once a day at most on the Hobby plan and anywhere within the hour, production only, no retries, the occasional double run, and now labelled legacy in favour of Vercel's Schedules. A cron on your laptop stops when the lid closes.

After the close, in which time zone?

US stocks close at 16:00 in New York, and EODHD APIs update the NYSE and NASDAQ end-of-day bar within 15 minutes; other exchanges two to three hours after theirs. GitHub's schedule is UTC unless you say otherwise, and New York changes its clocks twice a year:

               close   bar ready   job runs
New York       16:00   16:15       17:30
UTC, summer    20:00   20:15       21:30
UTC, winter    21:00   21:15       22:30

Name the time zone: GitHub's schedule takes an optional IANA time zone beside the cron line, so 30 17 * * 1-5 with America/New_York is 17:30 there all year. If GitHub refuses the workflow file at the timezone line, use the UTC form instead. Or stay in UTC at a time after the close in both seasons: 30 22 * * 1-5 is 18:30 in New York in summer and 17:30 in winter, and survives a move to a scheduler without time zones.

Three of GitHub's rules decide the rest:

  • Not on the hour. Scheduled runs can be delayed under high load, the start of every hour is a high-load time, and under enough load queued jobs may be dropped.
  • Default branch only. A schedule runs from the default branch, and only if the file is there; on a feature branch it never fires.
  • Five plain fields. The shortest interval is five minutes, and @daily is not supported.

Weekdays are 1-5. On a holiday the job finds no new bar and does nothing; lesson 4 turns that into a plain nothing new line, and lesson 6 makes sure it is not reported as a failure.

Your fork has Actions switched off. Workflows do not run in a fork until you enable Actions in its Actions tab, and a public repository's scheduled workflows are disabled by default when it is forked. Enable it now.

The prompt

Plan this one first: press Shift+Tab until plan mode shows, or type /plan — the same in Claude Code and Codex — and the agent proposes without editing. Paste:

Plan first. Add .github/workflows/alert.yml to run our alert job.
- Triggers: schedule at 30 17 * * 1-5 with timezone America/New_York, and workflow_dispatch for manual runs.
- One job on ubuntu-latest, timeout-minutes 10, concurrency group "alert" with cancel-in-progress false.
- Steps: the checkout and setup-node steps from .github/workflows/key-scan.yml, then npm ci, then npm run alert with EODHD_MOCK set to "1" in its env. No secrets yet. Make scripts/alert.ts print the bar date of every symbol it read.
Explain each trigger and the concurrency block in one sentence before writing. Do not touch key-scan.yml.

What the agent should do. One new file of about thirty lines, perhaps a line in scripts/alert.ts, nothing else. Read the cron line aloud against the table before you accept it.

Check it yourself

Off the default branch a schedule does not exist, so commit first, then push the branch, open a pull request and merge it:

npm test
git status          # the workflow and the script, and no .env file
git add -A
git commit -m "ci(alert): run the alert on weekdays at 17:30 New York, and on demand"
  1. The Actions tab lists Alert with a Run workflow button.
  2. Run it with the button or gh workflow run alert.yml, and watch it with gh run list --workflow alert.yml.
  3. The run is green within minutes; its log shows the price line, a bar date per symbol and your FIRED line.
  4. After 17:30 New York on the next weekday, a run with the event schedule appears, a few minutes late. None within an hour? Check Actions in the fork, the default branch, then the cron line.

Break it on purpose

Delete the timezone line. 30 17 * * 1-5 now means 17:30 UTC, mid-session in New York in both seasons, when the newest bar is the previous day's. Nothing fails; the alert arrives on time every day, about the wrong day. Put the line back.

Compare with ours

git fetch upstream, then git diff upstream/ref/runs-without-you/2 -- .github.

Our version, on branch ref/runs-without-you/2
on:
  schedule:
    - cron: "30 17 * * 1-5"
      timezone: "America/New_York"
  workflow_dispatch:

Below it: concurrency group alert, timeout-minutes: 10 (the default is 360), the starter's checkout, setup-node and npm ci, then npm run alert with EODHD_MOCK: "1".

Try it now

Checkpoint: the job exists and has run once.

  1. The commit you made for the checks is merged:
git fetch origin
git log --oneline -1 origin/main -- .github/workflows/alert.yml
  1. Write in PLAN.md the UTC time your job runs in summer and in winter.
  2. Take the lesson check. It hands you cron lines and asks when they run in New York.