Your organization has a secret that must be available to all the repositories within GitHub Actions workflows.You need to store the secret. The solution must minimize administrative effort.What should you do in GitHub?
Answer(s): D
To store a secret securely while keeping administration low and making it available to all repositories, you must create a GitHub Organization Secret and set its visibility to "All repositories". This removes the administrative burden of manually creating and updating the secret across individual repositories.Steps to Configure in the GitHub UIFollow these steps to create an organization-level secret:-> 1. Navigate to your GitHub Organization page.2. Click on the Gear Settings tab in the top navigation bar.-> 3. In the left sidebar, expand Secrets and variables and click Actions.4. Click the New organization secret button.5. Enter a Name and the Value for your secret.6. Under Repository access, select All repositories.
https://docs.github.com/actions/security-guides/using-secrets-in-github-actions
Which workflow commands send information from the runner? (Each correct answer presents a complete solution. Choose two.)
Answer(s): B,D
[B] Setting a debug messagePrints a debug message to the log. You must create a secret named ACTIONS_STEP_DEBUG with the value true to see the debug messages set by this command in the log.::debug::{message}Example: Setting a debug message echo "::debug::Set the Octocat variable"[D] Setting an output parameterSets a step's output parameter. Note that the step will need an id to be defined to later retrieve the output value.echo "{name}={value}" >> "$GITHUB_OUTPUT"Example of setting an output parameterThis example demonstrates how to set the SELECTED_COLOR output parameter and later retrieve it:- name: Set color id: color-selector run: echo "SELECTED_COLOR=green" >> "$GITHUB_OUTPUT"- name: Get color env:SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }}run: echo "The selected color is $SELECTED_COLOR"
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands
As a developer, which of the following snippets will enable you to run the commands npm ci and npm run build as part of a workflow?
Answer(s): A
Use the run: keyword only, not the shell keyword.Use the special character |.Note: There are two ways to run commands one after another on Github Actions.On the same step:steps:- name: Run both python files run: |python manage.py runserver python abc.pyOn different steps (that will run in sequence):steps:- name: Run first python file run: python manage.py runserver- name: Run second python file run: python abc.pyIncorrect:[Not B, Not E] Use run not shell.[Not C] Use run only, not the shell command.[Not D] Need to use the | character.
https://stackoverflow.com/questions/71047777/how-to-run-two-commands-on-github-actions-instance-one-afte r-another
You need to make a script to retrieve workflow run logs via the API. Which is the correct API to download a workflow run log?
Answer(s): B
REST API endpoints for workflow jobsYou can use the REST API to view logs and workflow jobs in GitHub Actions.Download job logs for a workflow runGets a redirect URL to download a plain text file of logs for a workflow job.Code samples for "Download job logs for a workflow run"Request exampleGet /repos/{owner}/{repo}/actions/jobs/{job_id}/logs
https://docs.github.com/en/rest/actions/workflow-jobs
As a DevOps engineer, you need to execute a deployment to different environments like development and testing based on the labels added to a pull request. The deployment should use the releases branch and trigger only when there is a change in the files under ‘apps’ folder. Which code block should be used to define the deployment workflow trigger?
Answer(s): C
Incorrect:[Not A] pull_request activitiy type labeled not specified.pull_request_label is not a trigger.[Not B] Specifies branches branches that has a name that starts with releases. We are only interested in the release branch.branches:- 'releases/**'[Not C]pull_request_reviewRuns your workflow when a pull request review is submitted, edited, or dismissed. A pull request review is a group of pull request review comments in addition to a body comment and a state.
https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows
Post your Comments and Discuss Microsoft GH-200 exam prep with other Community members:
Our website is free, but we have to fight against AI bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the GH-200 content, but please register or login to continue.