Skip to content

Commit

Permalink
Add download artefacts
Browse files Browse the repository at this point in the history
  • Loading branch information
trallard committed Jun 12, 2024
1 parent a5738a7 commit 2ed9ae9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,29 @@ jobs:
contents: write # needed to edit the comment vs opening multiple ones
actions: read
steps:
- name: "Download coverage data 📥"
uses: actions/download-artifact@v4
with:
route: GET /repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Check if the trigger was a PR event"
run: |
TRIGGER_EVENT=$(echo '${{ steps.get-run.outputs.data }}' | jq -r '.event')
if [[ "$TRIGGER_EVENT" != "pull_request" ]]; then
echo "Workflow was not triggered by a PR, skipping coverage comment."
exit 78 # Exiting with a neutral status
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# this needs the .coverage file so we download from the CI workflow artifacts
- name: "Download coverage data 📥"
uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: "Post coverage comment"
uses: py-cov-action/python-coverage-comment-action@v3
with:
Expand Down

0 comments on commit 2ed9ae9

Please sign in to comment.