-
Notifications
You must be signed in to change notification settings - Fork 80
48 lines (46 loc) · 1.87 KB
/
publish-check-ci.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
name: Publish Check CI results
# WARNING:
# workflow_run provides read-write repo token and access to secrets.
# Do *not* merge changes to this file without the proper review.
# We should only be running trusted code here.
on:
workflow_run:
workflows: ["Check CI"]
types:
- completed
jobs:
# Job based on https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
publish-check-ci:
runs-on: ubuntu-22.04
steps:
# Unfortunately, the official actions/download-artifact action is very limited in scope.
# Can't use it yet in this context, https://github.com/actions/download-artifact/issues/60
- name: Download artifact
uses: actions/github-script@v7
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "check-ci-results"
})[0];
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/check-ci-results.zip', Buffer.from(download.data));
- run: unzip check-ci-results.zip
- name: Publish Test Results
uses: scacap/action-surefire-report@v1
env:
NODE_OPTIONS: '--max_old_space_size=4096'
with:
check_name: check-ci test report
commit: ${{ github.event.workflow_run.head_sha }}
report_paths: '**/build/test-results/*/TEST-*.xml'