Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Nov 15, 2023
1 parent 1a1eb1a commit 98b1a21
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/notify-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
# so next time we campare against the current coverage.
echo ${{ github.sha }} > head-sha.txt
echo "save_current=true" >> "$GITHUB_OUTPUT"
echo "should_notify=false" >> "$GITHUB_OUTPUT"
exit 0
fi
Expand All @@ -49,16 +48,10 @@ jobs:
if [ "$PREV_SHA" == "${{ github.sha }}" ]
then
echo "No new commits since last run."
echo "save_current=false" >> "$GITHUB_OUTPUT"
echo "should_notify=false" >> "$GITHUB_OUTPUT"
exit 0
fi
# Update the head-sha.txt file with the current sha,
# so next time we campare against the current coverage.
echo ${{ github.sha }} > head-sha.txt
# Query the previous coverage from codecov
curl --request GET \
--url "https://api.codecov.io/api/v2/github/${{ github.repository_owner }}/repos/${{ github.event.repository.name }}/totals/?sha=$PREV_SHA" \
Expand Down Expand Up @@ -90,19 +83,20 @@ jobs:
if [ "$( cat coverage-prev.txt )" == "null" ]
then
echo "Previous coverage not available."
echo "save_current=true" >> "$GITHUB_OUTPUT"
echo ${{ github.sha }} > head-sha.txt
echo "should_notify=false" >> "$GITHUB_OUTPUT"
exit 0
fi
if [ "$( cat coverage.txt )" == "null" ]
then
echo "Current coverage not available."
echo "save_current=false" >> "$GITHUB_OUTPUT"
# Note that we don't update the head-sha.txt file here,
# so next time we compare against the one that had coverage data.
echo "should_notify=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "save_current=true" >> "$GITHUB_OUTPUT"
echo ${{ github.sha }} > head-sha.txt
echo "should_notify=true" >> "$GITHUB_OUTPUT"
- name: Compare with previous summary and make message
id: make_msg
Expand All @@ -121,7 +115,6 @@ jobs:
echo $MSG
echo $MSG >> "$GITHUB_OUTPUT"
- name: Upload current HEAD sha
if: steps.get_coverage.outputs.save_current == 'true'
uses: actions/upload-artifact@v3
with:
name: head-sha.txt
Expand Down

0 comments on commit 98b1a21

Please sign in to comment.