Skip to content

Commit

Permalink
fix(get-matrix-outputs): fix typo in artifact name
Browse files Browse the repository at this point in the history
  • Loading branch information
neilime committed Mar 13, 2023
1 parent c3b56db commit b6ab41c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/__shared-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ jobs:
uses: ./.github/workflows/linter.yml
secrets:
github-token: ${{ secrets.github-token }}

test-matrix-outputs:
name: Test get & set matrix outputs actions
needs: linter
uses: ./.github/workflows/__test-matrix-outputs.yml
32 changes: 32 additions & 0 deletions .github/workflows/__test-matrix-outputs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Internal - Test for get matrix outputs

on:
workflow_call:

jobs:
set-and-get-matrix-outputs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: ./actions/set-matrix-output
with:
value: '"test content 1"'
artifact-name: "test-matrix-outputs"

- uses: ./actions/set-matrix-output
with:
value: '"test content 2"'
artifact-name: "test-matrix-outputs"

- id: get-matrix-outputs
uses: ./actions/get-matrix-outputs
with:
artifact-name: test-matrix-outputs

- name: Check matrix outputs
run: |
if [ "${{ steps.get-matrix-outputs.outputs.result }}" != '["test content 1","test content 2"]' ]; then
echo "Get matrix outputs result is not valid"
exit 1
fi
4 changes: 2 additions & 2 deletions actions/get-matrix-outputs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ inputs:
outputs:
result:
description: "The matrix combined JSON outputs."
value: ${{ steps.get-matrix-outputs.outputs.result }}
value: ${{ steps.read-artifacts.outputs.result }}

runs:
using: "composite"
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ inputs.artifact-name }}}
name: ${{ inputs.artifact-name }}
path: /tmp/${{ inputs.artifact-name }}

- id: read-artifacts
Expand Down
6 changes: 1 addition & 5 deletions actions/set-matrix-output/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ inputs:
artifact-name:
description: "The name of the artifact to upload."
required: true
outputs:
result:
description: "The matrix combined JSON outputs."
value: ${{ steps.get-issue-number.outputs.result }}

runs:
using: "composite"
Expand All @@ -41,7 +37,7 @@ runs:
exit 1
fi
echo '${{ inputs.matrix-output }}' > "$MATRIX_OUTPUT_FILE"
echo '${{ inputs.value }}' > "$MATRIX_OUTPUT_FILE"
- uses: actions/upload-artifact@v3
with:
Expand Down

0 comments on commit b6ab41c

Please sign in to comment.