nerdexam
GitHub

GITHUB-ACTIONS · Question #16

As a developer, what is the safest way to reference an action to prevent modification of the underlying code?

The correct answer is A. Use a commit hash.. Using a commit hash is the safest method because it references a specific point in time in the repository's history. This ensures that the action is locked to that exact version and will not be affected by any future changes or modifications to the codebase. Even if the action is

Author and maintain actions

Question

As a developer, what is the safest way to reference an action to prevent modification of the underlying code?

Options

  • AUse a commit hash.
  • BUse a branch name.
  • CUse a patch release tag.
  • DUse a major release tag.

How the community answered

(40 responses)
  • A
    90% (36)
  • B
    5% (2)
  • C
    3% (1)
  • D
    3% (1)

Explanation

Using a commit hash is the safest method because it references a specific point in time in the repository's history. This ensures that the action is locked to that exact version and will not be affected by any future changes or modifications to the codebase. Even if the action is updated later, your workflow will continue using the specific commit you referenced.

Topics

#action security#commit SHA#version pinning#supply chain security

Community Discussion

No community discussion yet for this question.

Full GITHUB-ACTIONS Practice