Skip to content

GH-200 · Domain 2: Consume and troubleshoot workflows · 19% of the exam

Task 2.3: Use and manage workflow templates

Public and organization workflow templates, consuming reusable workflows, when a template, a reusable workflow or a composite action fits, and disabling versus deleting a workflow.

Study it

  • Workflow templates, reusable workflows and composite actions, and disabling workflows

    Lesson coming

Sample questions

Try each one before opening the answer. Every option is explained, with the GitHub documentation page that proves it.

Question 1 · choose 1

An organization keeps its workflow templates in a private .github repository. Developers creating workflows in the organization's private repositories see the templates, but in its public open source repositories the templates don't appear. The templates contain no sensitive content. What should the organization change?

  1. AChange the .github repository to public
  2. BChange the .github repository to internal
  3. CCopy the templates into each public repository's workflow-templates folder
  4. DAdd the public repositories' languages to each template's categories
Show the answer and why
  • AChange the .github repository to public

    Correct

    Templates in a public .github repository are available to all repository types.

  • BChange the .github repository to internal

    Incorrect

    Templates in an internal .github repository reach only internal and private repositories.

  • CCopy the templates into each public repository's workflow-templates folder

    Incorrect

    Repositories don't offer templates from their own folders.

  • DAdd the public repositories' languages to each template's categories

    Incorrect

    Categories decide which groups a template is shown under, such as a language; they don't change which repository types it is offered to.

A repository can use templates from a .github repository whose visibility matches or is broader than its own. Templates in a public .github repository are available to all repository types, in an internal one to internal and private repositories, and in a private one only to private repositories.

Question 2 · choose 2

A team is choosing between a reusable workflow and a composite action for shared build logic. Which two statements are true? (Choose TWO.)

  1. AA composite action's steps each appear as separate steps in the caller's log
  2. BA reusable workflow can be stored in any folder of its repository
  3. CA composite action can be published to GitHub Marketplace, and a reusable workflow can't
  4. DA reusable workflow's jobs can run on a different runner than the caller's jobs
  5. EA composite action can define several jobs that run in parallel
Show the answer and why
  • AA composite action's steps each appear as separate steps in the caller's log

    Incorrect

    A composite action is logged as one step, even if it has many.

  • BA reusable workflow can be stored in any folder of its repository

    Incorrect

    Each reusable workflow is a file in the repository's .github/workflows directory.

  • CA composite action can be published to GitHub Marketplace, and a reusable workflow can't

    Correct

    Composite actions can be listed on Marketplace; reusable workflows can't.

  • DA reusable workflow's jobs can run on a different runner than the caller's jobs

    Correct

    Each job of a reusable workflow chooses its own runner.

  • EA composite action can define several jobs that run in parallel

    Incorrect

    Composite actions contain steps only; jobs belong to workflows.

Reusable workflows are files in .github/workflows that contain jobs, each with its own runner, and they log every job and step separately. Composite actions contain no jobs, are logged as one step and can be published to GitHub Marketplace; reusable workflows can't.

Question 3 · choose 1

Teams want a one-click way to add CI to new repositories from the Actions tab. The platform team also wants to change the build logic later in one place, without teams re-adding anything. What should the platform team publish?

  1. AA workflow template containing the full build logic
  2. BA workflow template whose job calls a reusable workflow kept in a central repository
  3. CA reusable workflow alone, announced to teams by email
  4. DA required workflow that rulesets add to every repository
Show the answer and why
  • AA workflow template containing the full build logic

    Incorrect

    One click works, but the build logic would then sit in each repository's own workflow file rather than in one place.

  • BA workflow template whose job calls a reusable workflow kept in a central repository

    Correct

    The template adds the workflow in one click, and the logic it calls stays maintained in one place.

  • CA reusable workflow alone, announced to teams by email

    Incorrect

    The logic stays central, but nothing appears in the Actions tab for one-click setup.

  • DA required workflow that rulesets add to every repository

    Incorrect

    A ruleset can require a workflow to pass before merging; it doesn't give teams a one-click template.

Workflow templates let people create a workflow from the Actions tab quickly, and a template can reference a reusable workflow so that the centrally managed code stays in one place. Referencing it by SHA pins the exact version; a tag or branch lets updates flow to callers.

Question 4 · choose 1

A developer wants to add a GitHub-provided Python CI workflow to a repository that already has workflows. Where does she start?

  1. ASettings, then Actions, then General
  2. BActions, then New workflow, then Configure on the template
  3. CInsights, then Dependency graph
  4. DCode, then Add file, then Upload files
Show the answer and why
  • ASettings, then Actions, then General

    Incorrect

    Those settings control Actions policies, not new workflows.

  • BActions, then New workflow, then Configure on the template

    Correct

    The Choose a workflow page lists templates to configure and commit.

  • CInsights, then Dependency graph

    Incorrect

    That shows dependencies, not workflow templates.

  • DCode, then Add file, then Upload files

    Incorrect

    Uploading files doesn't offer templates.

In the Actions tab, New workflow opens the Choose a workflow page with recommended templates. Configure opens the template for editing before it is committed.

Question 5 · choose 1

An organization wants its own workflow templates to appear for its members. Where are they stored?

  1. AIn .github/workflows of every repository
  2. BIn the organization's settings under Actions
  3. CIn a repository named workflow-templates
  4. DIn the workflow-templates directory of the organization's .github repository
Show the answer and why
  • AIn .github/workflows of every repository

    Incorrect

    That folder holds a repository's own workflows.

  • BIn the organization's settings under Actions

    Incorrect

    Templates are files, not settings.

  • CIn a repository named workflow-templates

    Incorrect

    workflow-templates is a directory inside the .github repository.

  • DIn the workflow-templates directory of the organization's .github repository

    Correct

    Template files and their metadata go in that directory.

To create workflow templates for an organization, create a repository named .github if it doesn't exist, add a workflow-templates directory, and put each template and its metadata file there.

Question 6 · choose 1

Ten repositories created workflows from an organization template last year. The template was improved yesterday. What happens to the ten workflows?

  1. AThey update on their next run
  2. BThey are disabled until reviewed
  3. CThey show a banner offering to merge the changes automatically
  4. DThey don't change until each repository edits its own file
Show the answer and why
  • AThey update on their next run

    Incorrect

    A copy made from a template isn't linked back to it.

  • BThey are disabled until reviewed

    Incorrect

    Changing a template doesn't affect existing workflows.

  • CThey show a banner offering to merge the changes automatically

    Incorrect

    GitHub doesn't track copies made from templates.

  • DThey don't change until each repository edits its own file

    Correct

    A workflow created from a template is an independent copy.

A workflow template is a scaffold that is copied when someone creates a workflow, after which the workflow is independent and later changes to the template don't reach it.

Question 7 · choose 1

A maintainer wants to turn off a scheduled workflow from the terminal for a few weeks and later turn it back on with a single command. Which command fits?

  1. Agh run cancel with the ID of the workflow's latest run
  2. Bgh workflow disable with the workflow's name
  3. Cgh run delete with the ID of the workflow's latest run
  4. Dgit rm on the workflow file
Show the answer and why
  • Agh run cancel with the ID of the workflow's latest run

    Incorrect

    That cancels one run; the schedule stays active.

  • Bgh workflow disable with the workflow's name

    Correct

    It turns the workflow off, and gh workflow enable turns it back on.

  • Cgh run delete with the ID of the workflow's latest run

    Incorrect

    That deletes a run, not the workflow's triggers.

  • Dgit rm on the workflow file

    Incorrect

    Bringing a removed file back takes a new commit, not one gh command.

A workflow can be disabled and enabled from the Actions tab, the REST API or GitHub CLI with gh workflow disable and gh workflow enable.

Practice domain 2 →Practice all domains →