Modern Development — Actions, Packages, CI/CD
This domain accounts for 18% of the GitHub Foundations exam — the second-largest domain — and tests your ability to understand, configure, and reason about GitHub's automation and DevOps tooling. Questions focus on what each feature does, how components relate to one another, default behaviors, tier availability, and when to choose one approach over another. Expect scenario-based questions where you must select the correct workflow trigger, runner type, package registry, or security feature for a described use case.
GitHub Actions Overview: Workflows, Jobs, Steps, Runners
GitHub Actions is GitHub's built-in CI/CD and automation platform. It allows you to automate software workflows directly in your repository.
Core Concepts
| Term | Definition | Scope |
|---|---|---|
| Workflow | A YAML file in .github/workflows/ that defines automation | Repository |
| Event / Trigger | The condition that starts a workflow (e.g., push, schedule) | Workflow |
| Job | A set of steps that run on a single runner; jobs run in parallel by default | Workflow |
| Step | An individual task within a job; either a shell command (run) or an action (uses) | Job |
| Action | A reusable unit of code referenced in a step via uses: | Step |
| Runner | The machine (virtual or physical) that executes a job | Job |
Workflow File Location and Structure
- Must be stored in
.github/workflows/in the repository root. - File extension must be
.ymlor.yaml. - A repository can have multiple workflow files.
- Each workflow file can contain multiple jobs.
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "Hello World"
Key YAML keywords
on:— defines the triggerjobs:— contains all job definitionsruns-on:— specifies the runnersteps:— list of sequential steps within a jobuses:— references an actionrun:— executes a shell commandneeds:— declares job dependency (makes jobs run sequentially)env:— sets environment variableswith:— passes inputs to an action
Common traps:
- Jobs run in parallel by default; you must use
needs:to enforce sequential order. - A workflow file must be in the default branch to be triggered by most events (branch-scoped triggers may differ).
- Steps within a job always run sequentially, never in parallel.
uses:andrun:are mutually exclusive within a single step.
Workflow Triggers
Triggers (defined under on:) determine what event causes a workflow to execute.
Common Trigger Types
| Trigger | When It Fires | Notes |
|---|---|---|
push | On any push to matching branches/tags | Can filter with branches:, paths: |
pull_request | On PR open, synchronize, or reopen | Runs in the context of the PR merge commit |
schedule | On a cron schedule | Uses UTC; minimum interval is ~5 minutes |
workflow_dispatch | Manual trigger via UI, CLI, or API | Supports user-defined inputs: |
repository_dispatch | Triggered via REST API by external systems | Requires a custom event-type |
workflow_call | Called from another workflow (reusable workflows) | Supports inputs: and outputs: |
release | On GitHub release events (published, created, etc.) | Useful for deployment pipelines |
issues | On issue events (opened, closed, labeled) | Common for issue-triage automation |
Trigger Decision Flow
How to choose the right workflow trigger for a given scenario
Cron Syntax for schedule
- Format:
'minute hour day-of-month month day-of-week' - Example:
'0 2 * * 1'= every Monday at 2:00 AM UTC - Scheduled workflows only run on the default branch.
Common traps:
workflow_dispatchallows manual runs but does not trigger automatically; it is not a replacement forpush.repository_dispatchrequires an authenticated POST request to the GitHub API; it cannot be triggered by a simple UI click.pull_requestevents from forked repositories run with read-only permissions and no access to secrets by default.scheduletriggers do not guarantee exact timing; GitHub may delay them during high load.- Multiple triggers can be listed under
on:as an array:on: [push, pull_request].
Scenario: A team wants external Jenkins pipelines to trigger a GitHub Actions workflow after a successful build. Answer: Use repository_dispatch. Jenkins sends a POST request to the GitHub API with a custom event-type, and the workflow listens for on: repository_dispatch.
Unlock with a paid plan
11 more sections (about 2,704 words) continue below. Every paid plan unlocks all GH-900 study guides, the full question bank and mock exams, from $4.97/month.