Skip to content

Commit 1ccaa77

Browse files
committed
Use correct workflow name
1 parent d771cf0 commit 1ccaa77

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ BRANCH=${PULL_REQUEST_HEAD_REF:-${GITHUB_REF_NAME:-${BRANCH}}}
44
COMMIT_SHA="$(git rev-parse HEAD)"
55
COMMIT_SHA=${PULL_REQUEST_HEAD_SHA:-${GITHUB_SHA:-${COMMIT_SHA}}}
66

7-
# Read the Cesium version from package.json
7+
# Read the CesiumJS version from package.json
88
CESIUM_VERSION=$(npm pkg get version | tr -d '"')
99

1010
# Build artifact configuration

scripts/setDeployStatus.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import "@dotenvx/dotenvx/config";
44

55
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
66
const GITHUB_REPO = process.env.GITHUB_REPOSITORY;
7+
const GITHUB_WORKFLOW = process.env.GITHUB_WORKFLOW;
78
const COMMIT_SHA = process.env.COMMIT_SHA;
89
const CESIUM_VERSION = process.env.CESIUM_VERSION;
910

@@ -51,6 +52,14 @@ export async function setDeployStatus({ status, url, context, message }) {
5152
return result;
5253
}
5354

55+
const getArtifactContext = (artifact) => {
56+
if (!GITHUB_WORKFLOW || GITHUB_WORKFLOW === "") {
57+
return `artifact: ${artifact}`;
58+
}
59+
60+
return `${GITHUB_WORKFLOW} / artifact: ${artifact}`;
61+
};
62+
5463
await yargs()
5564
.command(
5665
"* <status> [context] [url] [message]",
@@ -84,7 +93,7 @@ await yargs()
8493
setDeployStatus({
8594
status,
8695
url: process.env.COVERAGE_URL,
87-
context: "deploy / artifact: coverage report",
96+
context: getArtifactContext("coverage report"),
8897
}),
8998
)
9099
.command(
@@ -95,7 +104,7 @@ await yargs()
95104
setDeployStatus({
96105
status,
97106
url: process.env.ZIP_URL,
98-
context: `deploy / artifact: Cesium-${CESIUM_VERSION}.zip`,
107+
context: getArtifactContext(`Cesium-${CESIUM_VERSION}.zip`),
99108
}),
100109
)
101110
.command(
@@ -106,7 +115,7 @@ await yargs()
106115
setDeployStatus({
107116
status,
108117
url: process.env.NPM_URL,
109-
context: `deploy / artifact: cesium-${CESIUM_VERSION}.tgz`,
118+
context: getArtifactContext(`cesium-${CESIUM_VERSION}.tgz`),
110119
}),
111120
)
112121
.command(
@@ -117,7 +126,7 @@ await yargs()
117126
setDeployStatus({
118127
status,
119128
url: process.env.INDEX_URL,
120-
context: "deploy / artifact: index.html",
129+
context: getArtifactContext("index.html"),
121130
}),
122131
)
123132
.parse(hideBin(process.argv));

0 commit comments

Comments
 (0)