GitHub Actions Interview Questions Hindi mein

GitHub Actions कोर्स के 25 सवाल, हर सवाल के सही जवाब और explanation के साथ। जवाब देखने से पहले ख़ुद सोचें।

GitHub Actions Fundamentals

1. Where are GitHub Actions workflows stored?

  1. Only in organisation settings
  2. In the repository wiki
  3. In .github/workflows/ in the repository
  4. In package.json
जवाब देखें

जवाब: In .github/workflows/ in the repository

Workflows are versioned with the code.

पाठ: What GitHub Actions Does

2. Do two jobs in the same workflow share files by default?

  1. No, each job runs on a fresh runner; use artifacts or outputs to pass data
  2. Yes, always
  3. Only on Windows runners
  4. Only if they have the same name
जवाब देखें

जवाब: No, each job runs on a fresh runner; use artifacts or outputs to pass data

Jobs are isolated.

पाठ: Anatomy of a Workflow

3. Why are self-hosted runners risky for public repositories?

  1. They do not support YAML
  2. They are slower
  3. They cannot run Linux
  4. Anyone can open a pull request that runs code on your machine
जवाब देखें

जवाब: Anyone can open a pull request that runs code on your machine

Untrusted code needs disposable runners.

पाठ: Runners

Triggers and Filters

4. Which trigger adds a manual "Run workflow" button?

  1. push
  2. workflow_dispatch
  3. schedule
  4. pull_request
जवाब देखें

जवाब: workflow_dispatch

Manual runs with inputs.

पाठ: Common Events

5. With paths [src/**, !**/*.md], does changing only src/README.md trigger the workflow?

  1. Yes, because it is under src/
  2. No, the later negation excludes Markdown files
  3. Only on Mondays
  4. Only for forks
जवाब देखें

जवाब: No, the later negation excludes Markdown files

Later patterns win.

पाठ: Branch and Path Filters

6. Which time zone do GitHub Actions cron schedules use?

  1. US Pacific time
  2. The repository owner's local time
  3. The runner's local time
  4. UTC
जवाब देखें

जवाब: UTC

Always UTC.

पाठ: Scheduled Workflows

Jobs, Steps and Data Flow

7. What is the difference between uses and run?

  1. uses runs a packaged action; run executes shell commands
  2. They are identical
  3. run only works on Windows
  4. uses only installs Node.js
जवाब देखें

जवाब: uses runs a packaged action; run executes shell commands

Actions versus scripts.

पाठ: Steps: uses and run

8. What happens to a job whose needs dependency failed?

  1. It retries forever
  2. It runs anyway
  3. It is skipped, unless its if condition uses a status function such as always()
  4. It deletes the workflow
जवाब देखें

जवाब: It is skipped, unless its if condition uses a status function such as always()

Dependencies gate execution.

पाठ: Job Dependencies With needs

9. How does one job read a value produced by another job?

  1. Through environment variables automatically
  2. Through a shared /tmp folder
  3. Through job outputs, via needs.<job>.outputs.<name>
  4. It cannot
जवाब देखें

जवाब: Through job outputs, via needs.<job>.outputs.<name>

Explicit outputs cross job boundaries.

पाठ: Outputs and Artifacts

Matrices, Expressions and Conditions

10. What does fail-fast: false change?

  1. Other matrix jobs keep running when one fails
  2. The matrix runs sequentially
  3. Failures are ignored
  4. Only the first combination runs
जवाब देखें

जवाब: Other matrix jobs keep running when one fails

See every result.

पाठ: Matrix Builds

11. When are ${{ }} expressions in a run: script evaluated?

  1. Only on Windows
  2. By the shell at runtime
  3. Never
  4. Before the shell runs the script, by GitHub Actions
जवाब देखें

जवाब: Before the shell runs the script, by GitHub Actions

Substitution happens first.

पाठ: Expressions and Contexts

12. Which status function runs a step even when earlier steps failed but not when the run is cancelled?

  1. success()
  2. !cancelled()
  3. always() only
  4. never()
जवाब देखें

जवाब: !cancelled()

Cleanup without running on cancellation.

पाठ: Conditional Steps and Jobs

Faster, Cheaper Pipelines

13. What should a dependency cache key usually include?

  1. The current time
  2. The OS and a hash of the lockfile
  3. A random number
  4. The workflow file name only
जवाब देखें

जवाब: The OS and a hash of the lockfile

Change the key exactly when dependencies change.

पाठ: Dependency Caching

14. What does cancel-in-progress: true do for a new run in the same group?

  1. Deletes the group
  2. Cancels the new run
  3. Runs both in parallel
  4. Cancels the older in-progress run
जवाब देखें

जवाब: Cancels the older in-progress run

Newest run wins.

पाठ: Concurrency Groups

15. What is the default job timeout?

  1. 6 hours
  2. 5 minutes
  3. 30 seconds
  4. There is no limit
जवाब देखें

जवाब: 6 hours

Set your own.

पाठ: Timeouts, Sizing and Splitting

Securing Workflows

16. What happens to unspecified scopes once you set permissions:?

  1. They keep the repository default
  2. They become write
  3. They are set to none
  4. The workflow fails to start
जवाब देखें

जवाब: They are set to none

Explicit allow-list.

पाठ: GITHUB_TOKEN Permissions

17. How should an issue title be used in a run: script?

  1. Inside eval
  2. Directly as ${{ github.event.issue.title }} in the script
  3. Through an environment variable, referenced as "$TITLE"
  4. Base64 decoded and executed
जवाब देखें

जवाब: Through an environment variable, referenced as "$TITLE"

Data in env, not in code.

पाठ: Script Injection From Untrusted Input

18. Why pin actions to a commit SHA instead of a tag?

  1. Tags can be moved to different code; a SHA always refers to the same code
  2. SHAs run faster
  3. Tags are not allowed
  4. SHAs include secrets
जवाब देखें

जवाब: Tags can be moved to different code; a SHA always refers to the same code

Immutable references.

पाठ: Pinning Third-Party Actions

19. What advantage does OIDC give over storing cloud keys as secrets?

  1. No need for permissions
  2. Faster builds
  3. Free cloud usage
  4. Short-lived credentials with no long-lived key to leak
जवाब देखें

जवाब: Short-lived credentials with no long-lived key to leak

Federation instead of static keys.

पाठ: Secrets and OIDC

Reuse and Deployment

20. Which trigger makes a workflow callable by other workflows?

  1. workflow_dispatch
  2. workflow_call
  3. repository_dispatch
  4. push
जवाब देखें

जवाब: workflow_call

Reusable workflows are called as jobs.

पाठ: Reusable Workflows

21. When is a composite action a better fit than a reusable workflow?

  1. When reusing whole multi-job pipelines
  2. When reusing a sequence of steps inside jobs
  3. When you need a cron schedule
  4. Never
जवाब देखें

जवाब: When reusing a sequence of steps inside jobs

Steps versus jobs.

पाठ: Composite Actions

22. What can an environment protection rule require?

  1. A different YAML syntax
  2. A faster runner
  3. A larger cache
  4. Approval from designated reviewers before the job runs
जवाब देखें

जवाब: Approval from designated reviewers before the job runs

Human gates for sensitive deploys.

पाठ: Environments, Approvals and Releases

Linting, Debugging and a Checklist

23. Which mistake can actionlint catch without running the workflow?

  1. A needs: reference to a job that does not exist
  2. A failing unit test
  3. A slow network
  4. An expired cloud credential
जवाब देखें

जवाब: A needs: reference to a job that does not exist

Static analysis of workflow files.

पाठ: Linting Workflows With actionlint

24. How do you enable more detailed step logs?

  1. Increase the timeout
  2. Delete the workflow
  3. Set ACTIONS_STEP_DEBUG to true or re-run with debug logging
  4. Use a macOS runner
जवाब देखें

जवाब: Set ACTIONS_STEP_DEBUG to true or re-run with debug logging

Debug logging on demand.

पाठ: Debugging Failing Runs

25. Which item belongs on a GitHub Actions review checklist?

  1. Write-all token permissions by default
  2. Self-hosted runners for public repositories
  3. Third-party actions pinned to full commit SHAs
  4. Issue titles inserted directly into run scripts
जवाब देखें

जवाब: Third-party actions pinned to full commit SHAs

Least privilege and immutable dependencies.

पाठ: A GitHub Actions Review Checklist

← कोर्स पर वापस जाएँ