π· Debug matrix job outputs #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| package: ${{ fromJSON('["a", "b", "c"]') }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Simulate digest output | |
| id: build | |
| run: | | |
| RAND=$(openssl rand -hex 16) | |
| echo "digest=${RAND}" > $GITHUB_OUTPUT | |
| - name: Export digest | |
| run: | | |
| mkdir -p ${{ runner.temp }}/digests/ | |
| digest="${{ steps.build.outputs.digest }}" | |
| echo "${digest#sha256:}" >> "${{ runner.temp }}/digests/${{ matrix.package }}" | |
| - name: Upload digest | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: digest-${{ matrix.package }} | |
| path: ${{ runner.temp }}/digests/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - name: Download digests | |
| uses: actions/download-artifact@v5 | |
| with: | |
| path: ${{ runner.temp }}/digests | |
| pattern: digest-* | |
| merge-multiple: true | |
| - name: List digests | |
| run: | | |
| echo "Digests by package:" | |
| for path in ${{ runner.temp }}/digests/*; do | |
| name=$(basename "$path") | |
| echo "$name: $(cat "$path")" | |
| done | |
| echo "πππ" |