GitHub Actions — Level by Level›Level 1 · Cheat sheet & self-check

Level 1 — Foundations · wrap-up

Cheat sheet & self-check

13 questions across 4 lessons. Each answer links back to the lesson it came from.

Pick an answer to see if you got it, and why.

  1. Q1. Where does GitHub look for workflow definitions?

    Show answer

    B. Every YAML file in .github/workflows is a workflow; it's versioned and reviewed like the rest of the code.

    From lesson 01 · Workflows, events and your first pipeline
  2. Q2. What's the difference between `uses:` and `run:` in a step?

    Show answer

    B. Actions are reusable building blocks; run is plain shell. Most workflows combine both.

    From lesson 01 · Workflows, events and your first pipeline
  3. Q3. Why set `permissions:` explicitly?

    Show answer

    B. Least privilege for the automatic token is one of the simplest, most effective hardening steps.

    From lesson 01 · Workflows, events and your first pipeline
  4. Q4. Are secrets available to workflows triggered by pull requests from forks?

    Show answer

    B. GitHub withholds secrets from fork PR runs by default. Be very careful with pull_request_target, which runs with the base repository's permissions.

    From lesson 01 · Workflows, events and your first pipeline
  5. Q5. Two jobs in a workflow have no `needs`. How do they run?

    Show answer

    B. Jobs are independent by default. Use `needs` to order them and artifacts or outputs to pass data.

    From lesson 02 · The execution model
  6. Q6. Why is `run: echo "${{ github.event.pull_request.title }}"` dangerous?

    Show answer

    B. Expressions are expanded into the script text. Use `env: TITLE: ${{ … }}` and reference "$TITLE" in the script.

    From lesson 02 · The execution model
  7. Q7. What does setting `permissions: contents: read` at the top of a workflow do?

    Show answer

    B. Grant only what each workflow or job needs (e.g. packages: write only on the publish job).

    From lesson 02 · The execution model
  8. Q8. What's the difference between a reusable workflow and a composite action?

    Show answer

    B. Use reusable workflows for whole pipelines (build, deploy); composite actions for shared step sequences.

    From lesson 03 · Real pipelines
  9. Q9. Why capture the image digest from the build step?

    Show answer

    B. Deploying by digest makes releases and rollbacks exact (see the scenario in lesson 05).

    From lesson 03 · Real pipelines
  10. Q10. How do you require a human approval before a production deploy job runs?

    Show answer

    B. Environment protection rules pause the job until an approver allows it, and environment secrets are only available after approval.

    From lesson 03 · Real pipelines
  11. Q11. Why generate tags with docker/metadata-action instead of hard-coding them?

    Show answer

    B. Consistent, derived tags make every image traceable to its source and release.

    From lesson 04 · Build, test and publish container images
  12. Q12. What does cache-from/cache-to type=gha do?

    Show answer

    B. Ephemeral runners start empty; a remote layer cache brings back fast rebuilds.

    From lesson 04 · Build, test and publish container images
  13. Q13. Why promote by opening a pull request against the GitOps repo, rather than committing directly?

    Show answer

    B. The same workflow serves every environment: auto-merge where risk is low, human approval where it isn't.

    From lesson 04 · Build, test and publish container images