TODO

Questions

  1. What file extension is used for GitHub Actions workflow files?

    1. .workflow

    2. .yml or .yaml

    3. .github

    4. .actions

  2. Where must the GitHub Actions workflow files be placed in a repository?

    1. In the root directory of the repository

    2. In the .github/workflows/ directory

    3. In the actions/ directory

    4. In the workflow/ directory

  3. Which event can trigger a GitHub Actions workflow?

    1. Push to a repository

    2. A pull request is opened

    3. A GitHub release is created

    4. All of the above

  4. What is a runner in GitHub Actions?

    1. A type of workflow

    2. A user who triggers the workflow

    3. The virtual environment in which the workflow runs

    4. A specific task within a job

  5. How can you reuse workflows in GitHub Actions?

    1. By linking to another workflow file in the repository

    2. Using the uses keyword in your workflow to reference an action

    3. By copying the workflow file to another repository

    4. It is not possible to reuse workflows

  6. What is a job in the context of GitHub Actions?

    1. A step in a workflow

    2. An individual task that runs sequentially in a workflow

    3. A collection of steps that run in parallel

    4. A set of workflows that are executed on a trigger event

  7. How are secrets stored and used in GitHub Actions?

    1. In plain text files within the repository

    2. As environment variables in the virtual environment

    3. In the repository settings as encrypted secrets

    4. They are not supported; all sensitive data must be hard-coded

Answers

  1. Answer: b. .yml or .yaml

    Explanation: GitHub Actions workflows are defined in YAML files with .yml or .yaml extensions.

  2. Answer: b. In the .github/workflows/ directory

    Explanation: Workflow files must be placed in the .github/workflows/ directory of your repository.

  3. Answer: d. All of the above

    Explanation: GitHub Actions workflows can be triggered by a variety of events such as a push, pull request, release, and many more.

  4. Answer: c. The virtual environment in which the workflow runs

    Explanation: A runner is a server that has the GitHub Actions runner application installed. It runs one job at a time.

  5. Answer: b. Using the uses keyword in your workflow to reference an action

    Explanation: The uses keyword can be used to reuse an action as a step within a job.

  6. Answer: b. An individual task that runs sequentially in a workflow

    Explanation: A job is a set of steps in a workflow that executes on the same runner. By default, jobs run in parallel unless specified otherwise.

  7. Answer: c. In the repository settings as encrypted secrets

    Explanation: Secrets are stored encrypted and exposed to the workflow run as environment variables.