GH-200 practice question 1 of 15

Which action type should be used to bundle a series of run steps into a reusable custom action?

Full set: 100 questions
Answer options
A: Composite action Correct answer
B: Bash script action
C: Docker container action
D: JavaScript action
Correct Answer:
A. Composite action
Explanation

A composite action allows you to combine multiple workflow steps, including run commands and uses of other actions, within a single action file. This is the designated method for bundling a sequence of shell commands and other actions into a reusable component that can be called as a single step in other workflows. This simplifies workflow files and promotes the "Don't Repeat Yourself" (DRY) principle by abstracting common sequences of tasks into a manageable, versionable unit.

Why Incorrect

B. A Bash script is a set of commands, but it is not a formal GitHub Actions "type" for bundling multiple distinct workflow steps into a reusable action.
C. A Docker container action is used to package the action's code and its environment, ensuring consistency, not for combining multiple run steps.
D. A JavaScript action executes code using a Node.js runtime. It is defined by a single main script file, not a sequence of run steps.

References

1. GitHub Docs. (2024). Creating a composite action. Introduction section. Retrieved from https://docs.github.com/en/actions/creating-actions/creating-a-composite-action. The document states, "A composite action allows you to combine multiple workflow steps within one action."

Scroll to Top