|
1 | 1 | import { summary } from "@actions/core"; |
2 | 2 | import { context, getOctokit } from "@actions/github"; |
3 | 3 | import { env } from "process"; |
4 | | -import { info } from "../utils"; |
| 4 | +import { info, warn } from "../utils"; |
5 | 5 | import { OutputEntryPagesDeployment } from "../wranglerArtifactManager"; |
6 | 6 | import { WranglerActionConfig } from "../wranglerAction"; |
7 | 7 |
|
@@ -95,25 +95,34 @@ export async function createGitHubDeploymentAndJobSummary( |
95 | 95 | pagesArtifactFields.deployment_trigger |
96 | 96 | ) { |
97 | 97 | const octokit = getOctokit(config.GITHUB_TOKEN); |
98 | | - await Promise.all([ |
99 | | - createGitHubDeployment({ |
100 | | - config, |
101 | | - octokit, |
102 | | - deploymentUrl: pagesArtifactFields.url, |
103 | | - productionBranch: pagesArtifactFields.production_branch, |
104 | | - environment: pagesArtifactFields.environment, |
105 | | - deploymentId: pagesArtifactFields.deployment_id, |
106 | | - projectName: pagesArtifactFields.pages_project, |
107 | | - }), |
108 | | - createJobSummary({ |
109 | | - commitHash: |
110 | | - pagesArtifactFields.deployment_trigger.metadata.commit_hash.substring( |
111 | | - 0, |
112 | | - 8, |
113 | | - ), |
114 | | - deploymentUrl: pagesArtifactFields.url, |
115 | | - aliasUrl: pagesArtifactFields.alias, |
116 | | - }), |
117 | | - ]); |
| 98 | + const [createGitHubDeploymentRes, createJobSummaryRes] = |
| 99 | + await Promise.allSettled([ |
| 100 | + createGitHubDeployment({ |
| 101 | + config, |
| 102 | + octokit, |
| 103 | + deploymentUrl: pagesArtifactFields.url, |
| 104 | + productionBranch: pagesArtifactFields.production_branch, |
| 105 | + environment: pagesArtifactFields.environment, |
| 106 | + deploymentId: pagesArtifactFields.deployment_id, |
| 107 | + projectName: pagesArtifactFields.pages_project, |
| 108 | + }), |
| 109 | + createJobSummary({ |
| 110 | + commitHash: |
| 111 | + pagesArtifactFields.deployment_trigger.metadata.commit_hash.substring( |
| 112 | + 0, |
| 113 | + 8, |
| 114 | + ), |
| 115 | + deploymentUrl: pagesArtifactFields.url, |
| 116 | + aliasUrl: pagesArtifactFields.alias, |
| 117 | + }), |
| 118 | + ]); |
| 119 | + |
| 120 | + if (createGitHubDeploymentRes.status === "rejected") { |
| 121 | + warn(config, "Creating Github Deployment failed"); |
| 122 | + } |
| 123 | + |
| 124 | + if (createJobSummaryRes.status === "rejected") { |
| 125 | + warn(config, "Creating Github Job summary failed"); |
| 126 | + } |
118 | 127 | } |
119 | 128 | } |
0 commit comments