Skip to content

Commit 4e4007c

Browse files
authored
Merge pull request #161 from SmoFlaDru/dev-benno
GH action additions: Comment with test results, support for Dependabot and PRs from forks
2 parents 23ce796 + 17e7f77 commit 4e4007c

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

.github/workflows/django.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,13 @@ jobs:
4646
uses: orgoro/[email protected]
4747
with:
4848
coverageFile: coverage.xml
49-
token: ${{ secrets.GITHUB_TOKEN }}
49+
token: ${{ secrets.GH_PR_WRITE_TOKEN }}
50+
event_file:
51+
name: "Event File"
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Upload
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: event-file
58+
path: ${{ github.event_path }}

.github/workflows/test-report.yml

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Test Report'
1+
name: 'Test Results'
22
on:
33
workflow_run:
44
workflows: ['Django CI']
@@ -8,6 +8,7 @@ permissions:
88
contents: read
99
actions: read
1010
checks: write
11+
pull-requests: write
1112
jobs:
1213
report:
1314
runs-on: ubuntu-latest
@@ -17,4 +18,21 @@ jobs:
1718
artifact: test-results
1819
name: Django Tests
1920
path: '*.xml'
20-
reporter: java-junit
21+
reporter: java-junit
22+
test-results:
23+
name: Test Results
24+
runs-on: ubuntu-latest
25+
if: github.event.workflow_run.conclusion != 'skipped'
26+
steps:
27+
- name: Download and Extract Artifacts
28+
uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d
29+
with:
30+
run_id: ${{ github.event.workflow_run.id }}
31+
path: artifacts
32+
- name: Publish Test Results
33+
uses: EnricoMi/publish-unit-test-result-action@v2
34+
with:
35+
commit: ${{ github.event.workflow_run.head_sha }}
36+
event_file: artifacts/event-file/event.json
37+
event_name: ${{ github.event.workflow_run.event }}
38+
files: "artifacts/**/*.xml"

0 commit comments

Comments
 (0)