Skip to content

Commit

Permalink
Use a random coverage artifact name if none is given (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored May 29, 2024
1 parent 48e97ea commit 7c6c120
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/actions/report-coverage/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: "Combine Coverage and Report"
inputs:
fail_under:
description: "The coverage amount to fail under"
default: 80
default: "80"
artifact_pattern:
description: ""
required: false
Expand Down
13 changes: 11 additions & 2 deletions .github/actions/upload-coverage/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ inputs:
artifact_name:
description: The artifact name - useful if multiple artifacts are created
required: false
default: coverage-data
default: ""

runs:
using: "composite"
Expand All @@ -17,9 +17,18 @@ runs:
if [ -f ".coverage" ]; then
mv .coverage ".coverage.-$$-$RANDOM"
fi
- name: Handle artifact name
id: artifact-name
shell: bash
run: |
export ARTIFACT_NAME=${{ inputs.artifact_name }}
if [ -z "$ARTIFACT_NAME" ]; then
export ARTIFACT_NAME="coverage-$RANDOM"
fi
echo "artifact_name=$ARTIFACT_NAME" >> "$GITHUB_OUTPUT"
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact_name }}
name: ${{ steps.artifact-name.outputs.artifact_name }}
path: ".coverage.*"
if-no-files-found: ignore

0 comments on commit 7c6c120

Please sign in to comment.