Reading CI/CD Config Files
5 exercises on reading GitHub Actions workflow YAML: event triggers, build matrices, reusable actions, environment variable scoping, and job dependency chains.
GitHub Actions YAML quick reference
on:— lists all triggers (push, pull_request, schedule, workflow_dispatch)jobs:— parallel units of work; each runs on its own runnerneeds:— declares a dependency; the job waits for listed jobs to succeedstrategy.matrix:— creates a run for every combination of valuesuses:— invokes a reusable action;run:executes a shell commandenv:— environment variables; workflow > job > step scope (inner wins)
0 / 5 completed
1 / 5
Read this GitHub Actions workflow excerpt and answer the question:
on:
push:
branches: [main, release/*]
pull_request:
branches: [main]
schedule:
- cron: '0 6 * * 1'
Which event triggers the workflow on a Monday morning at 06:00 UTC?The
GitHub Actions supports four common
So: every Monday at 06:00 UTC.
Common uses for scheduled workflows:
schedule trigger fires the workflow at 06:00 UTC every Monday.GitHub Actions supports four common
on: trigger types in this example:- push → fires when commits are pushed to matching branches (
mainor anyrelease/xbranch) - pull_request → fires when a PR is opened, synchronised, or reopened against
main - schedule → fires on a cron schedule, independent of git activity
0 6 * * 1 → minute=0, hour=6, any day-of-month, any month, weekday=1 (Monday).So: every Monday at 06:00 UTC.
Common uses for scheduled workflows:
- Nightly integration tests against a staging environment
- Weekly dependency audits (
npm audit/snyk) - Periodic health checks or reports
- trigger → the event that starts a workflow run
- on: → the YAML key listing all triggers for this workflow
- branches filter → restricts the trigger to specific branches; glob patterns like
release/*match any branch starting withrelease/