nerdexam
Microsoft

GH-200 · Question #39

Which configuration lines correctly set the workflow name in a GitHub Actions workflow file? (Choose 2)

The correct answer is B. name: ${{ 'release-flow-42' }} D. name: release-flow-42. Two valid ways to set the workflow name are (B) and (D). (D) 'name: release-flow-42' is the most straightforward method - a plain static string assigned to the 'name' key sets the workflow's display name in the GitHub Actions UI. (B) 'name: ${{ \'release-flow-42\' }}' uses a…

Author and Maintain Workflows

Question

Which configuration lines correctly set the workflow name in a GitHub Actions workflow file? (Choose 2)

Options

  • Aname: ${{ "release-flow-42" }}
  • Bname: ${{ 'release-flow-42' }}
  • Crun-name: release-flow-42
  • Dname: release-flow-42

How the community answered

(39 responses)
  • A
    3% (1)
  • B
    90% (35)
  • C
    8% (3)

Explanation

Two valid ways to set the workflow name are (B) and (D). (D) 'name: release-flow-42' is the most straightforward method - a plain static string assigned to the 'name' key sets the workflow's display name in the GitHub Actions UI. (B) 'name: ${{ 'release-flow-42' }}' uses a GitHub Actions expression with a string literal in single quotes, which is the required quoting style inside GitHub Actions expressions (${{ }}); this evaluates to the string 'release-flow-42' and is valid. (A) uses double quotes inside the expression, which is NOT valid syntax for string literals in GitHub Actions expressions - only single quotes are supported. (C) 'run-name' is a separate key that sets the display name for individual workflow runs, not the workflow's own name field.

Topics

#GitHub Actions#Workflow syntax#Workflow configuration#YAML

Community Discussion

No community discussion yet for this question.

Full GH-200 Practice