Skip to content

Commit

Permalink
Merge branch 'add-parameter-to-publish-only-diff-as-pr-comment' of gi…
Browse files Browse the repository at this point in the history
…thub.com:insightsengineering/coverage-action into add-parameter-to-publish-only-diff-as-pr-comment
  • Loading branch information
walkowif committed May 14, 2024
2 parents 2a4e4e6 + 82e2370 commit 4d3bfc6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CLA 🔏

on:
issue_comment:
types:
- created
# For PRs that originate from forks
pull_request_target:
types:
- opened
- closed
- synchronize

jobs:
CLA:
name: CLA 📝
uses: insightsengineering/.github/.github/workflows/cla.yaml@main
secrets: inherit
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ coverage percentage, and line numbers not covered by any test.
_Default_: `True`

### Outputs
None
* `summary`:

_Description_: Summary of coverage report

<!-- END_ACTION_DOC -->

## How it works
Expand Down
20 changes: 19 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ inputs:
required: false
default: true

outputs:
summary:
description: Summary of coverage report
value: ${{ steps.create-output.outputs.summary }}

branding: # https://feathericons.com/
icon: "umbrella"
color: "red"
Expand Down Expand Up @@ -279,7 +284,11 @@ runs:
fi
echo -e "\nResults for commit: $COMMIT_SHA\n" >> .coverage-output.final
echo -e "\n_Minimum allowed coverage is \`${{ inputs.threshold }}%\`_\n" >> .coverage-output.final
echo -e "\n:recycle: This comment has been updated with latest results\n" >> .coverage-output.final
if [[ "${{ inputs.publish }}" == "true" ]]
then {
echo -e "\n:recycle: This comment has been updated with latest results\n" >> .coverage-output.final
}
fi
shell: bash

- name: Post as comment
Expand All @@ -289,6 +298,15 @@ runs:
header: ${{ inputs.path }}
path: .coverage-output.final

- name: Set as output
id: create-output
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "summary<<$EOF" >> $GITHUB_OUTPUT
echo "$(cat .coverage-output.final)" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
shell: bash

- name: Commit XML report to ${{ inputs.diff-storage }}
if: >
contains(inputs.diff, 'true')
Expand Down

0 comments on commit 4d3bfc6

Please sign in to comment.