report #1174
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## have to upload via this seperate workflow | |
## to avoid limitations of PR's from forked | |
## repos which wont have write access by default. | |
name: report | |
on: | |
workflow_run: | |
workflows: [ci-build] | |
types: [completed] | |
permissions: | |
checks: write | |
pull-requests: write | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up GitHub CLI | |
uses: actions/setup-gh@v2 | |
- name: Get workflow run details | |
id: workflow_details | |
run: | | |
gh api repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }} \ | |
--jq '.head_branch' > branch.txt | |
BRANCH_NAME=$(cat branch.txt) | |
echo "branch_name=${BRANCH_NAME}" >> $GITHUB_ENV | |
- name: Fetch PR number | |
id: fetch_pr | |
run: | | |
PR=$(gh pr list --head "${{ env.branch_name }}" --json number --jq '.[0].number') | |
echo "pr_number=${PR}" >> $GITHUB_ENV | |
- name: Output PR number | |
run: | | |
echo "The PR number is: ${{ env.pr_number }}" | |
- name: Download Test Report | |
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2 | |
with: | |
name: junit-test-results | |
workflow: ${{ github.event.workflow.id }} | |
run_id: ${{ github.event.workflow_run.id }} | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@992d97d6eb2e5f3de985fbf9df6a04386874114d # v5 | |
with: | |
commit: ${{github.event.workflow_run.head_sha}} | |
report_paths: '**/build/test-results/test/TEST-*.xml' | |
comment: true |