A team configures a matrix workflow so each agent role writes a separate audit file. The team also wants an index artifact that can still be created when one agent role fails. Evaluate the following statements. 1. The matrix job can create one run-scoped artifact per agent role. 2. The index job downloads the role artifacts before creating the index. 3. The index job can run even if one matrix role fails.
name: multi-agent-observe
on:
pull_request:
branches:
- main
permissions:
contents: read
actions: read
pull-requests: read
jobs:
agent:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
agent: [planner, implementer, reviewer]
steps:
- uses: actions/checkout@v4
- name: Run agent role
run: |
mkdir -p audit
./agents/run-${{ matrix.agent }}.sh > audit/${{ matrix.agent }}.json
- name: Upload role audit
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: agent-${{ matrix.agent }}-audit-${{ github.run_id }}
path: audit/${{ matrix.agent }}.json
retention-days: 30
audit-index:
needs: agent
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Create index
run: |
mkdir -p audit
echo "run=${{ github.run_id }}" > audit/index.md
echo "source=matrix agent artifacts" >> audit/index.md
- name: Upload index
uses: actions/upload-artifact@v4
with:
name: audit-index-${{ github.run_id }}
path: audit/index.md
retention-days: 30Choose 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 upload-artifact step within the matrix job uses name: agent-${{ matrix.agent }}-audit-${{ github.runid }}, which creates a unique artifact name for each agent role, effectively creating one run-scoped artifact per agent. Statement 2 is No because the audit-index job does not contain any steps to download the individual agent role artifacts. It only creates a new index.md file. Statement 3 is Yes because fail-fast: false in the matrix strategy ensures that all matrix jobs attempt to run even if one fails, and if: ${{ always() }} on the audit-index job ensures it will run regardless of the success or failure of its needs job.
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