TOPIC 10/1916 MINNOT STARTED

GitHub Actions part 2: test every pull request, test on a schedule, and keep the report

Start the tests on every pull request and every night, make the result a check that must pass before merging, and upload the report so anyone can open it.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: a lighthouse keeper's lamp check. Every night the keeper checks the lamp, whether or not a ship asked. When a new course is proposed, the keeper checks again. A page of the log goes to the harbour office. A rule at the harbour says a ship may not sail while the page is marked bad.

The night check is the schedule. The proposed course is the . The page is the uploaded report. The harbour rule is the .

Mei works with Tom, a tester at Daily List, a to-do list app, to set all three.

What it is: This slice of GitHub Actions starts a workflow on a pull request and on a timer. are the pull_request and schedule keys. A GitHub Actions required status check must pass before a merge, and a is a saved report. A local pytest run is the neighbour. It does not block the merge button.

Why it matters: A pull request with no required check can merge a broken Daily List build. A night run catches a failure that nobody pushed today. A lost report forces Tom to retest. The three together let Mei see the result and stop a bad merge.

PLAIN WORDS · 4 in this section
github
a web site that hosts code and runs checks
workflow
the steps a piece of work follows, start to finish
pytest
A free Python tool that finds and runs checks.
retest
test again

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.

THE REAL JOB A lighthouse keeper's lamp check.

  1. Evening
  2. Ship
  3. Logbook
Lighthouse

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
The evening lamp checkThe scheduled trigger
The check for a new shipThe pull request trigger
The harbour office ruleThe required status check
The record book pageThe uploaded artifact

WHERE THIS PICTURE STOPS

  • The keeper checks the same lamp, but a schedule checks the default branch only.
  • A harbour rule can be bent, but a required check blocks the merge.
  • A record book page is kept long, but an artifact is kept for limited days.

HOOK

Evening check, ship check, record book.

TELL A FRIEND

A keeper with a lamp and a record book.

OFTEN MIXED UP WITH GitHub Actions part 1: write your first workflow file and read the run log. That topic writes the first . This one adds triggers, a and a saved report.

PRACTISE AND KEEP

Sources for this topic — 4 sources
  1. Market practice

    Events that trigger workflows (GitHub Docs) ↗ — GitHub Docs · GitHub Docs on events: schedule uses five-field cron in Coordinated Universal Time by default, the shortest gap is five minutes, scheduled runs use the latest commit on the default branch, and busy times such as the start of an hour can delay a run

    The GitHub Docs events page: schedule uses five-field cron in Coordinated Universal Time by default, and the shortest gap is five minutes. Scheduled runs use the latest commit on the default branch. Busy times such as the start of an hour can delay a run. · Checked 2026-10-31

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  2. Market practice

    Store and share data with workflow artifacts (GitHub Docs) ↗ — GitHub Docs · GitHub Docs artifact guide: upload-artifact takes a name and a path, retention-days is capped by the repository limit, a Python example uses if always so results upload even when tests fail, and deleting a run deletes its artifacts

    The GitHub Docs artifact guide: the upload-artifact action takes a name and a path, and retention-days is capped by the repository limit. A Python example uses if always so test results upload even when tests fail. Deleting a run deletes its artifacts. · Checked 2026-10-31

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  3. Market practice

    Status checks (GitHub Docs) ↗ — GitHub Docs · GitHub Docs on status checks: a required status check must pass before a pull request can merge

    The GitHub Docs page on status checks: a required status check must pass before a pull request can merge. · Checked 2026-10-31

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  4. Market practice

    About protected branches and required status checks (GitHub Docs) ↗ — GitHub · The GitHub pages on protected branches: required status checks must pass before a merge. An optional setting needs the branch to be up to date. A check must have run in the past seven days and be successful, skipped or neutral.

    The GitHub pages on protected branches: required status checks must pass before a merge. An optional setting needs the branch to be up to date. A check must have run in the past seven days and be successful, skipped or neutral. · Checked 2026-10-31

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.