-
Notifications
You must be signed in to change notification settings - Fork 161
51 lines (44 loc) · 1.57 KB
/
report.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
## 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