






















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!























































































Exam coverage:- Fundamentals of GitHub Actions : Covers core components (events, jobs, steps, runners), trigger events (push, pull_request, schedule, workflow_dispatch), and basic YAML syntax. Author and Maintain Workflows : Addresses workflow structure, job dependencies (needs), matrix strategies, concurrency control, environment variables, and reusable workflows. Consume and Troubleshoot Workflows : Focuses on debugging workflows, viewing logs, using artifacts and caching, handling errors, and troubleshooting common issues (command not found, permission denied, timeout errors). Author and Maintain Actions : Examines the creation of custom actions (JavaScript, Docker, and composite actions), action.yml metadata, inputs/outputs, and publishing actions to the GitHub Marketplace. Manage GitHub Actions for the Enterprise : Covers organizational policies for actions, self-hosted runner management,
security best practices (secrets, permissions), and auditing workflow usage. Section 1: Fundamentals of GitHub Actions (Questions 1-30)
CORRECT ANSWER : C) workflow_dispatch ✔ RATIONALE : The workflow_dispatch event allows a workflow to be triggered manually from the GitHub UI, GitHub CLI, or REST API. This is essential for manual testing or on-demand execution. push (A) is for code pushes, pull_request (B) is for pull request events, and schedule (D) is for cron-based triggers.
The cron key must be present. Option A is missing the cron key. Option B uses incorrect list syntax. Option C uses an invalid format for the cron expression.
B) Artifacts C) Secrets D) Caching CORRECT ANSWER : B) Artifacts ✔ RATIONALE : Artifacts are designed to share data between jobs in a workflow. They allow you to persist files (like build outputs, logs, or test reports) after a job completes, making them available for subsequent jobs or for download. Environment variables (A) are for configuration, secrets (C) are for sensitive data, and caching (D) is for dependencies.
RATIONALE : The caching feature is specifically designed to store and reuse dependencies and other frequently used files between workflow runs. This significantly speeds up workflows by avoiding redundant downloads.
my-runner (C) would not work because GitHub requires the self- hosted label to identify it as a self-hosted runner.
CORRECT ANSWER : A) if: failure() ✔ RATIONALE : The failure() function returns true when a previous step or job fails. Using if: failure() on a step ensures it only runs when a preceding step has failed.
branch must be filtered within the job using if: github.ref == 'refs/heads/main'. However, the correct way to include both triggers is to nest them properly. Option C shows a workflow that triggers on pushes to main and on a schedule.
A) Using env variables B) Using outputs C) Using artifacts D) Using secrets CORRECT ANSWER : B) Using outputs ✔ RATIONALE : To pass a value between steps within the same job, you can use step outputs. A step can set an output using echo "value" >> $GITHUB_OUTPUT, and subsequent steps can reference it using steps..outputs.. Artifacts (C) are for sharing data between jobs, not steps.
RATIONALE : The GITHUB_TOKEN is a automatically generated secret that GitHub provides to authenticate API requests made within a workflow. It is used for actions like checking out code, creating issues, or making commits.
useful for non-critical steps where failure should not halt the entire workflow.
CORRECT ANSWER : B) The GitHub Actions runner application ✔ RATIONALE : Self-hosted runners require the GitHub Actions runner application to be installed and configured on the machine. This application communicates with GitHub to receive and execute jobs.