1
1
name : Publish PR
2
+ run-name : ${{ github.workflow_run.display_title }}
2
3
3
4
on :
4
5
workflow_run :
15
16
github.event.workflow_run.conclusion == 'success'
16
17
}}
17
18
steps :
18
- - uses : actions/checkout@v4
19
19
- name : Print event info
20
20
uses : actions/github-script@v7
21
21
with :
@@ -25,21 +25,13 @@ jobs:
25
25
with :
26
26
script : |
27
27
const { owner, repo } = context.repo;
28
- const getKeys = (obj, until = Object.prototype) => {
29
- if (!obj || obj === until) return [];
30
- const ownKeys = Reflect.ownKeys(obj);
31
- const protoKeys = getKeys(Object.getPrototypeOf(obj), until);
32
- return new Set([...ownKeys, ...protoKeys]);
33
- };
34
- console.log('github', [...getKeys(github)]);
35
- console.log('github.rest', [...getKeys(github.rest)]);
36
- console.log('github.rest.actions', [...getKeys(github.rest.actions)]);
37
- const { total_count, artifacts } = await github.rest.actions.listWorkflowRunArtifacts({
28
+ const listArtifactsResponse = await github.rest.actions.listWorkflowRunArtifacts({
38
29
owner,
39
30
repo,
40
31
run_id: ${{ github.event.workflow_run.id }},
41
32
name: 'result',
42
33
});
34
+ const { total_count, artifacts } = listArtifactsResponse.data;
43
35
if (total_count !== 1) {
44
36
const summary = artifacts?.map(artifact => {
45
37
const { name, size_in_bytes, url } = artifact;
0 commit comments