Skip to content

Commit

Permalink
fix(get-matrix-outputs): delete artifacts after reading
Browse files Browse the repository at this point in the history
  • Loading branch information
neilime committed Jun 16, 2023
1 parent 08132c4 commit 42ea75e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/__test-action-matrix-outputs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ jobs:
echo "Get matrix outputs result is not valid"
exit 1
fi
- name: Check artifacts have been deleted
run: |
ARTIFACTS_PATH="/tmp/test-matrix-outputs"
if [ -d "$ARTIFACTS_PATH" ]; then
echo "Artifacts have not been deleted"
exit 1
fi
8 changes: 8 additions & 0 deletions actions/get-matrix-outputs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ inputs:
artifact-name:
description: "The name of the artifact to download."
required: true
remove-artifact:
description: "Define weather to remove the downloaded artifact."
required: false
default: "true"
outputs:
result:
description: "The matrix combined JSON outputs."
Expand All @@ -30,3 +34,7 @@ runs:
run: |
RESULT=$(jq -sc "." /tmp/${{ inputs.artifact-name }}/*.json)
echo "result<<EOF" >> "$GITHUB_OUTPUT" && echo "$RESULT" >> "$GITHUB_OUTPUT" && echo "EOF" >> "$GITHUB_OUTPUT"
- if: ${{ inputs.remove-artifact == 'true' }}
shell: bash
run: rm -rf /tmp/${{ inputs.artifact-name }}

0 comments on commit 42ea75e

Please sign in to comment.