@@ -4,6 +4,7 @@ import "@dotenvx/dotenvx/config";
44
55const GITHUB_TOKEN = process . env . GITHUB_TOKEN ;
66const GITHUB_REPO = process . env . GITHUB_REPOSITORY ;
7+ const GITHUB_WORKFLOW = process . env . GITHUB_WORKFLOW ;
78const COMMIT_SHA = process . env . COMMIT_SHA ;
89const 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+
5463await 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