Skip to content

Commit

Permalink
use a random coverage artifact name if none are given
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed May 29, 2024
1 parent 48e97ea commit 23d6532
Show file tree
Hide file tree
Showing 2 changed files with 11 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
12 changes: 10 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,17 @@ runs:
if [ -f ".coverage" ]; then
mv .coverage ".coverage.-$$-$RANDOM"
fi
- name: Handle artifact name
shell: bash
run: |
name=${{ inputs.artifact_name }}
if [ -z "$name" ]; then
name="coverage-$RANDOM"
fi
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact_name }}
name: ${{ env.ARTIFACT_NAME }}
path: ".coverage.*"
if-no-files-found: ignore

0 comments on commit 23d6532

Please sign in to comment.