@@ -95,6 +95,7 @@ export const friendlyBindingNames: Record<
9595 workflows : "Workflow" ,
9696 pipelines : "Pipeline" ,
9797 secrets_store_secrets : "Secrets Store Secret" ,
98+ artifacts : "Artifacts" ,
9899 ratelimits : "Rate Limit" ,
99100 assets : "Assets" ,
100101 unsafe_hello_world : "Hello World" ,
@@ -1714,6 +1715,16 @@ function normalizeAndValidateEnvironment(
17141715 validateBindingArray ( envName , validateSecretsStoreSecretBinding ) ,
17151716 [ ]
17161717 ) ,
1718+ artifacts : notInheritable (
1719+ diagnostics ,
1720+ topLevelEnv ,
1721+ rawConfig ,
1722+ rawEnv ,
1723+ envName ,
1724+ "artifacts" ,
1725+ validateBindingArray ( envName , validateArtifactsBinding ) ,
1726+ [ ]
1727+ ) ,
17171728 unsafe_hello_world : notInheritable (
17181729 diagnostics ,
17191730 topLevelEnv ,
@@ -4276,6 +4287,44 @@ const validateSecretsStoreSecretBinding: ValidatorFn = (
42764287 return isValid ;
42774288} ;
42784289
4290+ const validateArtifactsBinding : ValidatorFn = (
4291+ diagnostics ,
4292+ field ,
4293+ value
4294+ ) => {
4295+ if ( typeof value !== "object" || value === null ) {
4296+ diagnostics . errors . push (
4297+ `"artifacts" bindings should be objects, but got ${ JSON . stringify ( value ) } `
4298+ ) ;
4299+ return false ;
4300+ }
4301+ let isValid = true ;
4302+ if ( ! isRequiredProperty ( value , "binding" , "string" ) ) {
4303+ diagnostics . errors . push (
4304+ `"${ field } " bindings must have a string "binding" field but got ${ JSON . stringify (
4305+ value
4306+ ) } .`
4307+ ) ;
4308+ isValid = false ;
4309+ }
4310+
4311+ if ( "namespace" in value && typeof value . namespace !== "string" ) {
4312+ diagnostics . errors . push (
4313+ `"${ field } " bindings "namespace" field must be a string but got ${ JSON . stringify (
4314+ value . namespace
4315+ ) } .`
4316+ ) ;
4317+ isValid = false ;
4318+ }
4319+
4320+ validateAdditionalProperties ( diagnostics , field , Object . keys ( value ) , [
4321+ "binding" ,
4322+ "namespace" ,
4323+ ] ) ;
4324+
4325+ return isValid ;
4326+ } ;
4327+
42794328const validateHelloWorldBinding : ValidatorFn = ( diagnostics , field , value ) => {
42804329 if ( typeof value !== "object" || value === null ) {
42814330 diagnostics . errors . push (
0 commit comments