Study guide — GH-200
The official GitHub Actions syllabus, organized by domain. Check off each point as you review it.
Inicia sesión para guardar tu progreso entre sesiones.
Configure workflow triggers and events
Ver resumen
Pick the event by its source: schedule with cron (UTC unless a timezone is set, always on the default branch), workflow_dispatch for manual runs, repository_dispatch for external systems through the API with event_type and client_payload, and workflow_run to chain workflows. Events such as issues, issue_comment, release or pull_request_review cover repository activity.
Ver resumen
Narrow each event with types (without them pull_request only reacts to opened, synchronize and reopened) and with branches, tags and paths filters, which combine: all must be satisfied. Choose pull_request_target only for tasks that do not run pull request code. Declare permissions at workflow or job level: anything not listed becomes none.
Workflow syntax for GitHub Actions ↗Events that trigger workflows ↗
Ver resumen
workflow_dispatch inputs support the boolean, choice, number, environment and string types, with required, default and options (a choice default must be in options); read them with the inputs context, which keeps Booleans. In workflow_call, type is required and only allows boolean, number or string, and secrets are mapped by name or with secrets: inherit.
Design and implement workflow structure
Ver resumen
Job and step if conditions are evaluated by GitHub Actions and get an implicit success() unless they include always(), failure(), cancelled() or !cancelled(); an expression that starts with ! must be wrapped in ${{ }}. continue-on-error keeps a job (on a step) or the run (on a job) from failing, and timeout-minutes limits how long a step or a job can run.
Evaluate expressions in workflows and actions ↗Workflow syntax for GitHub Actions ↗
Ver resumen
Without needs, jobs run in parallel; needs, as a string or array, makes a job wait for the listed jobs to complete successfully. If a dependency fails or is skipped, every later job in the chain is skipped unless it uses a condition such as always() or !cancelled(). needs.<job_id>.result lets you react to the result of one specific dependency.
Using jobs in a workflow ↗Workflow syntax for GitHub Actions ↗
Ver resumen
Workflow commands are written to output as ::command parameters::value: group and endgroup nest lines, add-mask hides values (once per value per job), error, warning and notice create annotations with file and line, and stop-commands pauses processing with a random token. env is set at workflow, job or step level and the most specific wins; default GITHUB_* variables cannot be overwritten.
Ver resumen
services creates fresh Docker containers for each job (databases, caches or queues) that are destroyed when the job ends and require a Linux runner. If the job runs in a container, reach the service by its label without port mapping; if it runs on the runner, map ports and use localhost. options accepts Docker health checks, and command or entrypoint change how the service starts.
Communicating with Docker service containers ↗Workflow syntax for GitHub Actions ↗
Ver resumen
jobs.<job_id>.strategy.matrix creates one job per combination of variables; exclude removes combinations (a partial match is enough) and include adds keys or new combinations, and is processed after exclude. fail-fast (true by default) cancels the rest of the matrix when a job fails, and max-parallel limits simultaneous jobs. To avoid -latest label migrations, specify an explicit version label.
Running variations of jobs in a workflow ↗actions/runner-images README ↗
Ver resumen
YAML anchors (&) and aliases (*) reduce repetition inside a single workflow file: the anchor marks a node at its first occurrence (an env mapping, a list of steps or a whole job) and each alias repeats it later. An alias must come after its anchor, refers to the most recent preceding definition and cannot carry content of its own.
Ver resumen
Contexts expose run metadata: github.ref is the full ref and github.ref_name the short name; github.head_ref and github.base_ref exist only for pull request events; steps.<id>.outcome is the result before continue-on-error and conclusion the result after it; runner.os gives the operating system, and strategy.job-index and job-total describe the matrix. run_id stays the same on re-run while run_attempt increments.
Ver resumen
${{ }} expressions combine contexts, literals (strings in single quotes), operators and functions such as contains, startsWith, format, join, toJSON, fromJSON and hashFiles. Each key allows only certain contexts: jobs.<id>.if, which GitHub evaluates before sending the job to a runner, allows only github, needs, vars and inputs. To prevent leaks, never use structured data as a secret and rotate any exposed secret.
Evaluate expressions in workflows and actions ↗Secure use reference ↗
Ver resumen
The GitHub Actions extension for Visual Studio Code validates the workflow schema and expressions, offers code completion and integrated documentation for functions and event payloads, and parses inputs and outputs of referenced actions and reusable workflows. It also shows runs and logs and manages secrets and variables. It works with local clones, not with vscode.dev.
Manage workflow execution and outputs
Ver resumen
actions/cache stores paths under a key (for example runner.os plus hashFiles of the lock file); without an exact match it tries restore-keys as prefixes and restores the most recent cache, and an existing cache is never modified. upload-artifact accepts retention-days, bounded by the repository or organization limit, which is read and changed with GET and PUT on .../actions/permissions/artifact-and-log-retention.
Dependency caching reference ↗REST API endpoints for GitHub Actions permissions ↗
Ver resumen
Within a job, a step with an id writes name=value to GITHUB_OUTPUT and later steps read it with steps.<id>.outputs; GITHUB_ENV and GITHUB_PATH only affect later steps of the same job. Between jobs you use jobs.<id>.outputs and needs, or artifacts for files; a reusable workflow exposes job outputs in on.workflow_call.outputs. Outputs containing secrets are skipped.
Workflow commands for GitHub Actions ↗Passing information between jobs ↗
Ver resumen
Each step can add GitHub Flavored Markdown to the GITHUB_STEP_SUMMARY environment file, which is unique per step; when the job ends, its steps' summaries are grouped into one job summary on the run summary page. Use >> to append, > to overwrite the current step's content, and delete the file to remove it; uploaded content cannot be changed later and secrets are masked.
Ver resumen
A status badge uses https://github.com/OWNER/REPOSITORY/actions/workflows/WORKFLOW-FILE/badge.svg and shows the default branch by default; ?branch= and ?event= filter by branch or event, and private repository badges are not accessible externally. jobs.<job_id>.environment takes a name or an object with name and url (both can use expressions), and deployment: false uses environment secrets without creating a deployment.
Adding a workflow status badge ↗Workflow syntax for GitHub Actions ↗