8000 Replace Makefile with atmos.yaml by osterman · Pull Request #58 · cloudposse/github-action-matrix-outputs-write · GitHub
[go: up one dir, main page]

Skip to content

Replace Makefile with atmos.yaml #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations 8000
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions Makefile

This file was deleted.

68 changes: 33 additions & 35 deletions README.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
Expand All @@ -22,13 +21,17 @@ github_repo: cloudposse/github-action-matrix-outputs-write

# Badges to display
badges:
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/github-action-matrix-outputs-write.svg"
url: "https://github.com/cloudposse/github-action-matrix-outputs-write/releases/latest"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"
- name: Latest Release
image: https://img.shields.io/github/release/cloudposse/github-action-matrix-outputs-write.svg?style=for-the-badge
url: https://github.com/cloudposse/github-action-matrix-outputs-write/releases/latest
- name: Last Updated
image: https://img.shields.io/github/last-commit/cloudposse/github-action-matrix-outputs-write.svg?style=for-the-badge
url: https://github.com/cloudposse/github-action-matrix-outputs-write/commits
- name: Slack Community
image: https://slack.cloudposse.com/for-the-badge.svg
url: https://cloudposse.com/slack

# List any related terraform modules that this module may be used with or that this module depends on.
related:
- name: "github-action-matrix-outputs-read"
description: "Matrix outputs read"
Expand All @@ -42,25 +45,25 @@ introduction: |-
GitHub actions have an [Jobs need a way to reference all outputs of matrix jobs](https://github.com/community/community/discussions/17245) issue.
If there is a job that runs multiple times with `strategy.matrix` only the latest iteration's output availiable for
reference in other jobs.

There is a [workaround](https://github.com/community/community/discussions/17245#discussioncomment-3814009) to address the limitation.
We implement the workaround with two GitHub Actions:
* [Matrix Outputs Write](https://github.com/cloudposse/github-action-matrix-outputs-write)
* [Matrix Outputs Read](https://github.com/cloudposse/github-action-matrix-outputs-read)

## v1 - What's new

> [!IMPORTANT]
> cloudposse/github-action-matrix-outputs-write@v1+ is not currently supported on GHES yet. If you are on GHES, you
> must use [v0](https://github.com/cloudposse/github-action-matrix-outputs-write/releases/tag/0.5.0).

The release of `cloudposse/github-action-matrix-outputs-write@v1` and `cloudposse/github-action-matrix-outputs-read@v1`
are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements.

For more information, see the [`@actions/artifact`](https://github.com/actions/toolkit/tree/main/packages/artifact) documentation.

### Breaking Changes

1. On self hosted runners, additional [firewall rules](https://github.com/actions/toolkit/tree/main/packages/artifact#breaking-changes) may be required.
2. Outputs writen with `cloudposse/github-action-matrix-outputs-write@v1` can not be read by `cloudposse/github-action-matrix-outputs-read@v0`and below versions.

Expand All @@ -75,7 +78,7 @@ references:
# How to use this project
usage: |-
Example how you can use workaround to reference matrix job outputs.

```yaml
name: Pull Request
on:
Expand All @@ -92,7 +95,7 @@ usage: |-
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build
id: build
uses: cloudposse/github-action-docker-build-push@1.9.0
Expand All @@ -113,7 +116,7 @@ usage: |-
image: ${{ steps.build.outputs.image }}:${{ steps.build.outputs.tag }}
## Multiline string
tags: ${{ toJson(steps.build.outputs.image) }}

## Read matrix outputs
read:
runs-on: ubuntu-latest
Expand All @@ -123,7 +126,7 @@ usage: |-
id: read
with:
matrix-step-name: build

outputs:
result: "${{ steps.read.outputs.result }}"

Expand All @@ -146,11 +149,11 @@ usage: |-
```

### Reusable workflow example

Reusable workflow that support matrix outputs

`./.github/workflow/build-reusabled.yaml`

```yaml
name: Build - Reusable workflow
on:
Expand Down Expand Up @@ -178,7 +181,7 @@ usage: |-
image:
description: "Image"
value: ${{ jobs.write.outputs.image }}

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -197,7 +200,7 @@ usage: |-
PLATFORM=${{ inputs.platform }}
outputs:
image: ${{ needs.build.outputs.image }}:${{ needs.build.outputs.tag }}

write:
runs-on: ubuntu-latest
needs: [build]
Expand All @@ -210,14 +213,14 @@ usage: |-
matrix-key: ${{ inputs.matrix-key }}
outputs: |-
image: ${{ needs.build.outputs.image }}

outputs:
image: ${{ fromJson(steps.out.outputs.result).image }}
image_alternative: ${{ steps.out.outputs.image }}
```

Then you can use the workflow with matrix

```yaml
name: Pull Request
on:
Expand Down Expand Up @@ -269,9 +272,9 @@ usage: |-
## This how you can reference matrix output
actual: ${{ fromJson(needs.read.outputs.result).image.arm64v8 }}
```

or as a simple job

```yaml
name: Pull Request
on:
Expand Down Expand Up @@ -300,10 +303,5 @@ usage: |-
actual: ${{ needs.build.outputs.image }}
```

include:
- "docs/github-action.md"

# Contributors to this project
contributors:
- name: "Igor Rodionov"
github: "goruha"
include: []
contributors: []
2 changes: 2 additions & 0 deletions atmos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import:
- https://raw.githubusercontent.com/cloudposse/.github/refs/heads/main/.github/atmos/github-action.yaml
17 changes: 0 additions & 17 deletions docs/github-action.md

This file was deleted.

Loading
0