A repository uses three agent jobs: planner, implementer, and reviewer. The team wants a final audit job to run after all three jobs, collect the audit files, and publish a retained artifact that reviewers can download from the workflow run. Which option completes the workflow?
name: multi-agent-audit
on:
pull_request:
branches:
- main
permissions:
contents: read
actions: read
pull-requests: read
jobs:
planner:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
mkdir -p audit
echo "planner decision log" > audit/planner.md
- uses: actions/upload-artifact@v4
with:
name: planner-audit
path: audit/planner.md
implementer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
mkdir -p audit
echo '{"files_changed":["src/api.ts"]}' > audit/implementer.json
- uses: actions/upload-artifact@v4
with:
name: implementer-audit
path: audit/implementer.json
reviewer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
mkdir -p audit
echo "review findings" > audit/reviewer.md
- uses: actions/upload-artifact@v4
with:
name: reviewer-audit
path: audit/reviewer.md
audit_bundle:
(Missing value 1)
runs-on: ubuntu-latest
(Missing value 2)
steps:
- uses: actions/download-artifact@v4
with:
path: audit/raw
- name: Build audit index
run: |
find audit/raw -type f | sort > audit/index.txt
- name: Publish audit bundle
(Missing value 3)
with:
name: multi-agent-audit-${{ github.run_id }}
path: audit/
retention-days: 30Choose an answer
Tap an option to check your answer.
Correct answer: Missing value 1 = needs: [planner, implementer, reviewer] Missing value 2 = if: ${{ always() }} Missing value 3 = uses: actions/upload-artifact@v4.
Why this is the answer
The auditbundle job needs to run after all three agent jobs (planner, implementer, reviewer) have completed, so needs: [planner, implementer, reviewer] is correct. The if: ${{ always() }} condition ensures the audit job runs regardless of whether the preceding jobs succeeded or failed, which is crucial for collecting audit data even in case of issues. Finally, uses: actions/upload-artifact@v4 is the correct action to publish the collected audit files as a retained artifact. The other options are incorrect because needs: reviewer would not wait for all jobs, if: ${{ success() }} would prevent auditing failed runs, permissions: actions: write is irrelevant here, if: ${{ github.eventname == 'push' }} would restrict execution, run: tar -czf audit.tgz audit/ would create an archive but not publish it as an artifact, and uses: actions/cache@v4 is for caching dependencies, not publishing artifacts.
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