@andrian.yablonskyy/thub-common 1.0.30 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/validate-job-spec.js +3 -3
package/package.json
CHANGED
package/src/validate-job-spec.js
CHANGED
|
@@ -55,7 +55,7 @@ function legacyShapeError(spec){
|
|
|
55
55
|
const GIT_URL = /^(?:(?:https?|ssh|git):\/\/[^\s]+|[A-Za-z0-9._-]+@[A-Za-z0-9.-]+:[^\s]+)$/,
|
|
56
56
|
|
|
57
57
|
// Job env names the Client sets itself for a job's commands (besides
|
|
58
|
-
// THUB_*): git's safety settings.
|
|
58
|
+
// THUB_* and JOB_* — the job's own parameters): git's safety settings.
|
|
59
59
|
RESERVED_ENV = ['GIT_TERMINAL_PROMPT', 'GIT_ALLOW_PROTOCOL'];
|
|
60
60
|
|
|
61
61
|
// Rules across fields, spelled out here rather than as schema if/then,
|
|
@@ -69,9 +69,9 @@ function crossFieldErrors(spec){
|
|
|
69
69
|
errors.push('/git/url must be an https://, http://, ssh:// or git:// URL, or user@host:path');
|
|
70
70
|
}
|
|
71
71
|
const envNames = Object.keys(spec.env && typeof spec.env === 'object' ? spec.env : {}),
|
|
72
|
-
reserved = envNames.filter((n) => /^
|
|
72
|
+
reserved = envNames.filter((n) => /^(THUB|JOB)_/.test(n) || RESERVED_ENV.includes(n));
|
|
73
73
|
if (reserved.length){
|
|
74
|
-
errors.push(`/env ${reserved.join(', ')}: set by the Client itself (THUB_*, ${RESERVED_ENV.join(', ')}) — use other names`);
|
|
74
|
+
errors.push(`/env ${reserved.join(', ')}: set by the Client itself (THUB_*, JOB_*, ${RESERVED_ENV.join(', ')}) — use other names`);
|
|
75
75
|
}
|
|
76
76
|
if (spec.git?.options){
|
|
77
77
|
try {
|