How eepurichandra/github-action-matrix-outputs-read works
Main Components
• GitHub Actions Workflows: Represent the various workflow YAML files that drive different tests, builds, and releases (e.g., feature-branch, main-branch, release, setup-test, and multiple test workflows). These are the automation “pipelines” triggered by events (e.g., pull_request).
• Matrix Outputs Write Action: This component (referenced by cloudposse/github-action-matrix-outputs-write) is where each matrix job writes its outputs.
• Matrix Outputs Read Action: This action (cloudposse/github-action-matrix-outputs-read, the subject of the repository) is used to aggregate or fetch the outputs from the matrix jobs. It is used in subsequent “read” or “assert” jobs.
• Reusable Workflows: Illustrate the additional reusable workflow architecture (.github/workflow/build-reusabled.yaml) that encapsulates the build‐and‐write pattern in an independent workflow file.
• Downstream Jobs: Include downstream jobs that use or reference the matrix outputs (e.g., the “assert” job in the provided examples).
Relationships and Data Flow
• That the triggering event (such as a pull_request) launches the primary workflow.
• That the “read” job, depending on the “build” job, uses the Matrix Outputs Read Action to collect and aggregate those outputs.
• For the reusable workflow scenario, show how the build-reusabled.yaml workflow is invoked with matrix parameters and how its outputs eventually flow into subsequent jobs.
Architectural Patterns and Design Principles
• Use of a workaround pattern to overcome inherent GitHub Actions limitations regarding matrix outputs.
• Modular pattern; the action is split between write and read operations, making it easier to reuse in various GitHub Actions workflows.
• Clearly separate concerns between the build phase (producing outputs) and downstream consumption of outputs.
• Mention the integration with external GitHub Actions and GitHub infrastructure components, such as actions/checkout and external assert actions.
Relevant Technologies and Frameworks
• GitHub Actions and its YAML-based workflow engine.
• The native matrix strategies supported by GitHub Actions.
• The cloudposse actions (both the write and read actions) that implement the workaround.
• The overall event-driven design triggered by repository events (e.g., pull_request).