nerdexam
MicrosoftMicrosoft

GH-200 · Question #17

GH-200 Question #17: Real Exam Question with Answer & Explanation

The correct answer is B: runs:. The pre: line before the pre-if: line. Note: runs.pre-if Allows you to define conditions for the pre: action execution. The pre: action will only run if the conditions in pre-if are met. If not set, then pre-if defaults to always(). In pre-if, status check functions evaluate agai

Create and manage custom actions

Question

You are a DevOps engineer working on a custom action. You want to conditionally run a script at the start of the action, before the main entrypoint. Which code block should be used to define the metadata file for your custom action?

Options

  • Aruns:
  • Bruns:
  • Cruns:
  • Druns:

Explanation

The pre: line before the pre-if: line. Note: runs.pre-if Allows you to define conditions for the pre: action execution. The pre: action will only run if the conditions in pre-if are met. If not set, then pre-if defaults to always(). In pre-if, status check functions evaluate against the job's status, not the action's own status. Note that the step context is unavailable, as no steps have run yet. In this example, cleanup.js only runs on Linux-based runners: pre: 'cleanup.js' pre-if: runner.os == 'linux' https://docs.github.com/en/actions/reference/workflows-and-actions/metadata-syntax

Topics

#custom actions#action.yml#action lifecycle#pre-action script

Community Discussion

No community discussion yet for this question.

Full GH-200 PracticeBrowse All GH-200 Questions