A repository configures an agent workflow to run when maintainers label an issue as agent-ready. Evaluate the following statements. 1. The job can run when an issue is labeled agent-ready. 2. Repository secrets are available to the script without explicit references. 3. The workflow can create a branch and draft PR, but not edit issue labels.
name: invoke-agent-from-issue
on:
issues:
types:
- labeled
permissions:
contents: write
issues: read
pull-requests: write
jobs:
invoke-agent:
if: contains(github.event.issue.labels.*.name, 'agent-ready')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Invoke agent
env:
GH_TOKEN: ${{ github.token }}
ISSUE_URL: ${{ github.event.issue.html_url }}
run: |
./scripts/repo-agent \
--issue-url "$ISSUE_URL" \
--create-branch \
--draft-prChoose an answer
Tap an option to check your answer.
Correct answer: 1=Yes 2=No 3=Yes.
Why this is the answer
Statement 1 is Yes because the on: issues: types: - labeled trigger ensures the workflow runs when an issue is labeled, and the if: contains(github.event.issue.labels..name, 'agent-ready') condition specifically checks for the 'agent-ready' label. Statement 2 is No. Repository secrets must be explicitly referenced using the secrets context (e.g., secrets.MYSECRET) or passed as environment variables, as GHTOKEN is here. They are not automatically available to scripts. Statement 3 is Yes. The permissions section grants contents: write (for creating branches) and pull-requests: write (for drafting PRs). However, it only grants issues: read, not issues: write, meaning it cannot edit issue labels.
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