@@ -41,35 +41,39 @@ jobs:
41
41
with :
42
42
github-token : ${{secrets.GITHUB_TOKEN}}
43
43
script : |
44
- // Figure out workflow ID, commit and tree
45
- const { data: run } = await github.actions.getWorkflowRun({
46
- owner: context.repo.owner,
47
- repo: context.repo.repo,
48
- run_id: context.runId,
49
- });
50
- const workflow_id = run.workflow_id;
51
- const head_sha = run.head_sha;
52
- const tree_id = run.head_commit.tree_id;
44
+ try {
45
+ // Figure out workflow ID, commit and tree
46
+ const { data: run } = await github.actions.getWorkflowRun({
47
+ owner: context.repo.owner,
48
+ repo: context.repo.repo,
49
+ run_id: context.runId,
50
+ });
51
+ const workflow_id = run.workflow_id;
52
+ const head_sha = run.head_sha;
53
+ const tree_id = run.head_commit.tree_id;
53
54
54
- // See whether there is a successful run for that commit or tree
55
- const { data: runs } = await github.actions.listWorkflowRuns({
56
- owner: context.repo.owner,
57
- repo: context.repo.repo,
58
- per_page: 500,
59
- status: 'success',
60
- workflow_id,
61
- });
62
- for (const run of runs.workflow_runs) {
63
- if (head_sha === run.head_sha) {
64
- core.warning(`Successful run for the commit ${head_sha}: ${run.html_url}`);
65
- core.setOutput('enabled', ' but skip');
66
- break;
67
- }
68
- if (tree_id === run.head_commit.tree_id) {
69
- core.warning(`Successful run for the tree ${tree_id}: ${run.html_url}`);
70
- core.setOutput('enabled', ' but skip');
71
- break;
55
+ // See whether there is a successful run for that commit or tree
56
+ const { data: runs } = await github.actions.listWorkflowRuns({
57
+ owner: context.repo.owner,
58
+ repo: context.repo.repo,
59
+ per_page: 500,
60
+ status: 'success',
61
+ workflow_id,
62
+ });
63
+ for (const run of runs.workflow_runs) {
64
+ if (head_sha === run.head_sha) {
65
+ core.warning(`Successful run for the commit ${head_sha}: ${run.html_url}`);
66
+ core.setOutput('enabled', ' but skip');
67
+ break;
68
+ }
69
+ if (run.head_commit && tree_id === run.head_commit.tree_id) {
70
+ core.warning(`Successful run for the tree ${tree_id}: ${run.html_url}`);
71
+ core.setOutput('enabled', ' but skip');
72
+ break;
73
+ }
72
74
}
75
+ } catch (e) {
76
+ core.warning(e);
73
77
}
74
78
75
79
windows-build :
0 commit comments