A repository uses Copilot cloud agent to create draft pull requests from assigned issues. The team wants an escalation workflow that runs when the validation workflow completes, opens an issue only when the validation workflow fails, and gives the workflow enough permission to create the escalation issue using GitHub CLI. Which option completes the workflow?
name: escalate-agent-failure
on:
(Missing value 1):
workflows:
- validate-copilot-pr
types:
- completed
permissions:
contents: read
(Missing value 2): write
jobs:
open-escalation:
if: (Missing value 3)
runs-on: ubuntu-latest
steps:
- name: Create escalation issue
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh issue create \
--title "Copilot validation failed" \
--body "Review the failed workflow run and decide whether to retry, narrow the issue, or take ov
er manually."Choose an answer
Tap an option to check your answer.
Correct answer: Missing value 1 = workflow_run Missing value 2 = issues Missing value 3 = ${{ github.event.workflow_run.conclusion == 'failure' }}.
Why this is the answer
The correct option triggers the workflow on workflowrun events, specifically when the validate-copilot-pr workflow completes. This ensures the escalation workflow runs only after the validation workflow finishes. issues: write permission is necessary for the workflow to create a new GitHub issue using the GitHub CLI. The if condition github.event.workflowrun.conclusion == 'failure' correctly checks if the triggering workflow run (the validation workflow) failed, ensuring the escalation issue is opened only in that specific scenario. Incorrect options: pullrequest is incorrect because the trigger needs to be based on another workflow's completion, not a pull request event. checks permission is not for creating issues. failure() is a step-level function, not suitable for a job-level if condition based on a previous workflow's outcome. workflowdispatch is for manually triggering workflows and doesn't react to other workflow completions. actions permission is for managing workflow runs, not creating issues. github.event.conclusion is not the correct path for accessing the conclusion of a workflowrun event. push triggers on code pushes, not workflow completions. pull-requests permission is for managing pull requests, not issues. github.event.pullrequest.merged is irrelevant for a workflow triggered by another workflow's failure.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed