@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrian.yablonskyy/thub-common",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "Shared job-spec schema, state enums and a thin API client used by the Agent and Client",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -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) => /^THUB_/.test(n) || RESERVED_ENV.includes(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 {