@actions/languageserver 0.3.30 → 0.3.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/dist/cli.bundle.cjs +914 -319
- package/package.json +5 -5
package/dist/cli.bundle.cjs
CHANGED
|
@@ -3320,13 +3320,13 @@ var require_main2 = __commonJS({
|
|
|
3320
3320
|
}
|
|
3321
3321
|
DiagnosticRelatedInformation2.is = is;
|
|
3322
3322
|
})(DiagnosticRelatedInformation = exports3.DiagnosticRelatedInformation || (exports3.DiagnosticRelatedInformation = {}));
|
|
3323
|
-
var
|
|
3324
|
-
(function(
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
})(
|
|
3323
|
+
var DiagnosticSeverity4;
|
|
3324
|
+
(function(DiagnosticSeverity5) {
|
|
3325
|
+
DiagnosticSeverity5.Error = 1;
|
|
3326
|
+
DiagnosticSeverity5.Warning = 2;
|
|
3327
|
+
DiagnosticSeverity5.Information = 3;
|
|
3328
|
+
DiagnosticSeverity5.Hint = 4;
|
|
3329
|
+
})(DiagnosticSeverity4 = exports3.DiagnosticSeverity || (exports3.DiagnosticSeverity = {}));
|
|
3330
3330
|
var DiagnosticTag;
|
|
3331
3331
|
(function(DiagnosticTag2) {
|
|
3332
3332
|
DiagnosticTag2.Unnecessary = 1;
|
|
@@ -9619,7 +9619,7 @@ var require_createNode = __commonJS({
|
|
|
9619
9619
|
if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
|
|
9620
9620
|
value = value.valueOf();
|
|
9621
9621
|
}
|
|
9622
|
-
const { aliasDuplicateObjects, onAnchor, onTagObj, schema:
|
|
9622
|
+
const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema3, sourceObjects } = ctx;
|
|
9623
9623
|
let ref = void 0;
|
|
9624
9624
|
if (aliasDuplicateObjects && value && typeof value === "object") {
|
|
9625
9625
|
ref = sourceObjects.get(value);
|
|
@@ -9634,7 +9634,7 @@ var require_createNode = __commonJS({
|
|
|
9634
9634
|
}
|
|
9635
9635
|
if (tagName?.startsWith("!!"))
|
|
9636
9636
|
tagName = defaultTagPrefix + tagName.slice(2);
|
|
9637
|
-
let tagObj = findTagObject(value, tagName,
|
|
9637
|
+
let tagObj = findTagObject(value, tagName, schema3.tags);
|
|
9638
9638
|
if (!tagObj) {
|
|
9639
9639
|
if (value && typeof value.toJSON === "function") {
|
|
9640
9640
|
value = value.toJSON();
|
|
@@ -9645,7 +9645,7 @@ var require_createNode = __commonJS({
|
|
|
9645
9645
|
ref.node = node2;
|
|
9646
9646
|
return node2;
|
|
9647
9647
|
}
|
|
9648
|
-
tagObj = value instanceof Map ?
|
|
9648
|
+
tagObj = value instanceof Map ? schema3[identity.MAP] : Symbol.iterator in Object(value) ? schema3[identity.SEQ] : schema3[identity.MAP];
|
|
9649
9649
|
}
|
|
9650
9650
|
if (onTagObj) {
|
|
9651
9651
|
onTagObj(tagObj);
|
|
@@ -9671,7 +9671,7 @@ var require_Collection = __commonJS({
|
|
|
9671
9671
|
var createNode = require_createNode();
|
|
9672
9672
|
var identity = require_identity();
|
|
9673
9673
|
var Node = require_Node();
|
|
9674
|
-
function collectionFromPath(
|
|
9674
|
+
function collectionFromPath(schema3, path, value) {
|
|
9675
9675
|
let v = value;
|
|
9676
9676
|
for (let i = path.length - 1; i >= 0; --i) {
|
|
9677
9677
|
const k = path[i];
|
|
@@ -9689,16 +9689,16 @@ var require_Collection = __commonJS({
|
|
|
9689
9689
|
onAnchor: () => {
|
|
9690
9690
|
throw new Error("This should not happen, please report a bug.");
|
|
9691
9691
|
},
|
|
9692
|
-
schema:
|
|
9692
|
+
schema: schema3,
|
|
9693
9693
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
9694
9694
|
});
|
|
9695
9695
|
}
|
|
9696
9696
|
var isEmptyPath = (path) => path == null || typeof path === "object" && !!path[Symbol.iterator]().next().done;
|
|
9697
9697
|
var Collection2 = class extends Node.NodeBase {
|
|
9698
|
-
constructor(type,
|
|
9698
|
+
constructor(type, schema3) {
|
|
9699
9699
|
super(type);
|
|
9700
9700
|
Object.defineProperty(this, "schema", {
|
|
9701
|
-
value:
|
|
9701
|
+
value: schema3,
|
|
9702
9702
|
configurable: true,
|
|
9703
9703
|
enumerable: false,
|
|
9704
9704
|
writable: true
|
|
@@ -9709,11 +9709,11 @@ var require_Collection = __commonJS({
|
|
|
9709
9709
|
*
|
|
9710
9710
|
* @param schema - If defined, overwrites the original's schema
|
|
9711
9711
|
*/
|
|
9712
|
-
clone(
|
|
9712
|
+
clone(schema3) {
|
|
9713
9713
|
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
9714
|
-
if (
|
|
9715
|
-
copy.schema =
|
|
9716
|
-
copy.items = copy.items.map((it) => identity.isNode(it) || identity.isPair(it) ? it.clone(
|
|
9714
|
+
if (schema3)
|
|
9715
|
+
copy.schema = schema3;
|
|
9716
|
+
copy.items = copy.items.map((it) => identity.isNode(it) || identity.isPair(it) ? it.clone(schema3) : it);
|
|
9717
9717
|
if (this.range)
|
|
9718
9718
|
copy.range = this.range.slice();
|
|
9719
9719
|
return copy;
|
|
@@ -10662,12 +10662,12 @@ var require_Pair = __commonJS({
|
|
|
10662
10662
|
this.key = key;
|
|
10663
10663
|
this.value = value;
|
|
10664
10664
|
}
|
|
10665
|
-
clone(
|
|
10665
|
+
clone(schema3) {
|
|
10666
10666
|
let { key, value } = this;
|
|
10667
10667
|
if (identity.isNode(key))
|
|
10668
|
-
key = key.clone(
|
|
10668
|
+
key = key.clone(schema3);
|
|
10669
10669
|
if (identity.isNode(value))
|
|
10670
|
-
value = value.clone(
|
|
10670
|
+
value = value.clone(schema3);
|
|
10671
10671
|
return new _Pair(key, value);
|
|
10672
10672
|
}
|
|
10673
10673
|
toJSON(_, ctx) {
|
|
@@ -10853,17 +10853,17 @@ var require_YAMLMap = __commonJS({
|
|
|
10853
10853
|
static get tagName() {
|
|
10854
10854
|
return "tag:yaml.org,2002:map";
|
|
10855
10855
|
}
|
|
10856
|
-
constructor(
|
|
10857
|
-
super(identity.MAP,
|
|
10856
|
+
constructor(schema3) {
|
|
10857
|
+
super(identity.MAP, schema3);
|
|
10858
10858
|
this.items = [];
|
|
10859
10859
|
}
|
|
10860
10860
|
/**
|
|
10861
10861
|
* A generic collection parsing method that can be extended
|
|
10862
10862
|
* to other node classes that inherit from YAMLMap
|
|
10863
10863
|
*/
|
|
10864
|
-
static from(
|
|
10864
|
+
static from(schema3, obj, ctx) {
|
|
10865
10865
|
const { keepUndefined, replacer: replacer2 } = ctx;
|
|
10866
|
-
const map = new this(
|
|
10866
|
+
const map = new this(schema3);
|
|
10867
10867
|
const add = (key, value) => {
|
|
10868
10868
|
if (typeof replacer2 === "function")
|
|
10869
10869
|
value = replacer2.call(obj, key, value);
|
|
@@ -10879,8 +10879,8 @@ var require_YAMLMap = __commonJS({
|
|
|
10879
10879
|
for (const key of Object.keys(obj))
|
|
10880
10880
|
add(key, obj[key]);
|
|
10881
10881
|
}
|
|
10882
|
-
if (typeof
|
|
10883
|
-
map.items.sort(
|
|
10882
|
+
if (typeof schema3.sortMapEntries === "function") {
|
|
10883
|
+
map.items.sort(schema3.sortMapEntries);
|
|
10884
10884
|
}
|
|
10885
10885
|
return map;
|
|
10886
10886
|
}
|
|
@@ -10987,7 +10987,7 @@ var require_map = __commonJS({
|
|
|
10987
10987
|
onError("Expected a mapping for this tag");
|
|
10988
10988
|
return map2;
|
|
10989
10989
|
},
|
|
10990
|
-
createNode: (
|
|
10990
|
+
createNode: (schema3, obj, ctx) => YAMLMap.YAMLMap.from(schema3, obj, ctx)
|
|
10991
10991
|
};
|
|
10992
10992
|
exports2.map = map;
|
|
10993
10993
|
}
|
|
@@ -11007,8 +11007,8 @@ var require_YAMLSeq = __commonJS({
|
|
|
11007
11007
|
static get tagName() {
|
|
11008
11008
|
return "tag:yaml.org,2002:seq";
|
|
11009
11009
|
}
|
|
11010
|
-
constructor(
|
|
11011
|
-
super(identity.SEQ,
|
|
11010
|
+
constructor(schema3) {
|
|
11011
|
+
super(identity.SEQ, schema3);
|
|
11012
11012
|
this.items = [];
|
|
11013
11013
|
}
|
|
11014
11014
|
add(value) {
|
|
@@ -11083,9 +11083,9 @@ var require_YAMLSeq = __commonJS({
|
|
|
11083
11083
|
onComment
|
|
11084
11084
|
});
|
|
11085
11085
|
}
|
|
11086
|
-
static from(
|
|
11086
|
+
static from(schema3, obj, ctx) {
|
|
11087
11087
|
const { replacer: replacer2 } = ctx;
|
|
11088
|
-
const seq = new this(
|
|
11088
|
+
const seq = new this(schema3);
|
|
11089
11089
|
if (obj && Symbol.iterator in Object(obj)) {
|
|
11090
11090
|
let i = 0;
|
|
11091
11091
|
for (let it of obj) {
|
|
@@ -11125,7 +11125,7 @@ var require_seq = __commonJS({
|
|
|
11125
11125
|
onError("Expected a sequence for this tag");
|
|
11126
11126
|
return seq2;
|
|
11127
11127
|
},
|
|
11128
|
-
createNode: (
|
|
11128
|
+
createNode: (schema3, obj, ctx) => YAMLSeq.YAMLSeq.from(schema3, obj, ctx)
|
|
11129
11129
|
};
|
|
11130
11130
|
exports2.seq = seq;
|
|
11131
11131
|
}
|
|
@@ -11321,7 +11321,7 @@ var require_schema = __commonJS({
|
|
|
11321
11321
|
var bool = require_bool();
|
|
11322
11322
|
var float = require_float();
|
|
11323
11323
|
var int = require_int();
|
|
11324
|
-
var
|
|
11324
|
+
var schema3 = [
|
|
11325
11325
|
map.map,
|
|
11326
11326
|
seq.seq,
|
|
11327
11327
|
string.string,
|
|
@@ -11334,7 +11334,7 @@ var require_schema = __commonJS({
|
|
|
11334
11334
|
float.floatExp,
|
|
11335
11335
|
float.float
|
|
11336
11336
|
];
|
|
11337
|
-
exports2.schema =
|
|
11337
|
+
exports2.schema = schema3;
|
|
11338
11338
|
}
|
|
11339
11339
|
});
|
|
11340
11340
|
|
|
@@ -11400,8 +11400,8 @@ var require_schema2 = __commonJS({
|
|
|
11400
11400
|
return str;
|
|
11401
11401
|
}
|
|
11402
11402
|
};
|
|
11403
|
-
var
|
|
11404
|
-
exports2.schema =
|
|
11403
|
+
var schema3 = [map.map, seq.seq].concat(jsonScalars, jsonError);
|
|
11404
|
+
exports2.schema = schema3;
|
|
11405
11405
|
}
|
|
11406
11406
|
});
|
|
11407
11407
|
|
|
@@ -11504,9 +11504,9 @@ ${cn.comment}` : item.comment;
|
|
|
11504
11504
|
onError("Expected a sequence for this tag");
|
|
11505
11505
|
return seq;
|
|
11506
11506
|
}
|
|
11507
|
-
function createPairs(
|
|
11507
|
+
function createPairs(schema3, iterable, ctx) {
|
|
11508
11508
|
const { replacer: replacer2 } = ctx;
|
|
11509
|
-
const pairs2 = new YAMLSeq.YAMLSeq(
|
|
11509
|
+
const pairs2 = new YAMLSeq.YAMLSeq(schema3);
|
|
11510
11510
|
pairs2.tag = "tag:yaml.org,2002:pairs";
|
|
11511
11511
|
let i = 0;
|
|
11512
11512
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
@@ -11591,8 +11591,8 @@ var require_omap = __commonJS({
|
|
|
11591
11591
|
}
|
|
11592
11592
|
return map;
|
|
11593
11593
|
}
|
|
11594
|
-
static from(
|
|
11595
|
-
const pairs$1 = pairs.createPairs(
|
|
11594
|
+
static from(schema3, iterable, ctx) {
|
|
11595
|
+
const pairs$1 = pairs.createPairs(schema3, iterable, ctx);
|
|
11596
11596
|
const omap2 = new this();
|
|
11597
11597
|
omap2.items = pairs$1.items;
|
|
11598
11598
|
return omap2;
|
|
@@ -11619,7 +11619,7 @@ var require_omap = __commonJS({
|
|
|
11619
11619
|
}
|
|
11620
11620
|
return Object.assign(new YAMLOMap(), pairs$1);
|
|
11621
11621
|
},
|
|
11622
|
-
createNode: (
|
|
11622
|
+
createNode: (schema3, iterable, ctx) => YAMLOMap.from(schema3, iterable, ctx)
|
|
11623
11623
|
};
|
|
11624
11624
|
exports2.YAMLOMap = YAMLOMap;
|
|
11625
11625
|
exports2.omap = omap;
|
|
@@ -11794,8 +11794,8 @@ var require_set = __commonJS({
|
|
|
11794
11794
|
var Pair = require_Pair();
|
|
11795
11795
|
var YAMLMap = require_YAMLMap();
|
|
11796
11796
|
var YAMLSet = class _YAMLSet extends YAMLMap.YAMLMap {
|
|
11797
|
-
constructor(
|
|
11798
|
-
super(
|
|
11797
|
+
constructor(schema3) {
|
|
11798
|
+
super(schema3);
|
|
11799
11799
|
this.tag = _YAMLSet.tag;
|
|
11800
11800
|
}
|
|
11801
11801
|
add(key) {
|
|
@@ -11839,9 +11839,9 @@ var require_set = __commonJS({
|
|
|
11839
11839
|
else
|
|
11840
11840
|
throw new Error("Set items must all have null values");
|
|
11841
11841
|
}
|
|
11842
|
-
static from(
|
|
11842
|
+
static from(schema3, iterable, ctx) {
|
|
11843
11843
|
const { replacer: replacer2 } = ctx;
|
|
11844
|
-
const set2 = new this(
|
|
11844
|
+
const set2 = new this(schema3);
|
|
11845
11845
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
11846
11846
|
for (let value of iterable) {
|
|
11847
11847
|
if (typeof replacer2 === "function")
|
|
@@ -11858,7 +11858,7 @@ var require_set = __commonJS({
|
|
|
11858
11858
|
nodeClass: YAMLSet,
|
|
11859
11859
|
default: false,
|
|
11860
11860
|
tag: "tag:yaml.org,2002:set",
|
|
11861
|
-
createNode: (
|
|
11861
|
+
createNode: (schema3, iterable, ctx) => YAMLSet.from(schema3, iterable, ctx),
|
|
11862
11862
|
resolve(map, onError) {
|
|
11863
11863
|
if (identity.isMap(map)) {
|
|
11864
11864
|
if (map.hasAllNullValues(true))
|
|
@@ -11980,7 +11980,7 @@ var require_schema3 = __commonJS({
|
|
|
11980
11980
|
var pairs = require_pairs();
|
|
11981
11981
|
var set = require_set();
|
|
11982
11982
|
var timestamp = require_timestamp();
|
|
11983
|
-
var
|
|
11983
|
+
var schema3 = [
|
|
11984
11984
|
map.map,
|
|
11985
11985
|
seq.seq,
|
|
11986
11986
|
string.string,
|
|
@@ -12003,7 +12003,7 @@ var require_schema3 = __commonJS({
|
|
|
12003
12003
|
timestamp.floatTime,
|
|
12004
12004
|
timestamp.timestamp
|
|
12005
12005
|
];
|
|
12006
|
-
exports2.schema =
|
|
12006
|
+
exports2.schema = schema3;
|
|
12007
12007
|
}
|
|
12008
12008
|
});
|
|
12009
12009
|
|
|
@@ -12018,7 +12018,7 @@ var require_tags = __commonJS({
|
|
|
12018
12018
|
var bool = require_bool();
|
|
12019
12019
|
var float = require_float();
|
|
12020
12020
|
var int = require_int();
|
|
12021
|
-
var
|
|
12021
|
+
var schema3 = require_schema();
|
|
12022
12022
|
var schema$1 = require_schema2();
|
|
12023
12023
|
var binary = require_binary();
|
|
12024
12024
|
var merge3 = require_merge();
|
|
@@ -12028,7 +12028,7 @@ var require_tags = __commonJS({
|
|
|
12028
12028
|
var set = require_set();
|
|
12029
12029
|
var timestamp = require_timestamp();
|
|
12030
12030
|
var schemas = /* @__PURE__ */ new Map([
|
|
12031
|
-
["core",
|
|
12031
|
+
["core", schema3.schema],
|
|
12032
12032
|
["failsafe", [map.map, seq.seq, string.string]],
|
|
12033
12033
|
["json", schema$1.schema],
|
|
12034
12034
|
["yaml11", schema$2.schema],
|
|
@@ -12112,9 +12112,9 @@ var require_Schema = __commonJS({
|
|
|
12112
12112
|
var tags = require_tags();
|
|
12113
12113
|
var sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
12114
12114
|
var Schema = class _Schema {
|
|
12115
|
-
constructor({ compat, customTags, merge: merge3, resolveKnownTags, schema:
|
|
12115
|
+
constructor({ compat, customTags, merge: merge3, resolveKnownTags, schema: schema3, sortMapEntries, toStringDefaults }) {
|
|
12116
12116
|
this.compat = Array.isArray(compat) ? tags.getTags(compat, "compat") : compat ? tags.getTags(null, compat) : null;
|
|
12117
|
-
this.name = typeof
|
|
12117
|
+
this.name = typeof schema3 === "string" && schema3 || "core";
|
|
12118
12118
|
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
|
12119
12119
|
this.tags = tags.getTags(customTags, this.name, merge3);
|
|
12120
12120
|
this.toStringOptions = toStringDefaults ?? null;
|
|
@@ -13703,11 +13703,11 @@ var require_compose_scalar = __commonJS({
|
|
|
13703
13703
|
scalar.comment = comment;
|
|
13704
13704
|
return scalar;
|
|
13705
13705
|
}
|
|
13706
|
-
function findScalarTagByName(
|
|
13706
|
+
function findScalarTagByName(schema3, value, tagName, tagToken, onError) {
|
|
13707
13707
|
if (tagName === "!")
|
|
13708
|
-
return
|
|
13708
|
+
return schema3[identity.SCALAR];
|
|
13709
13709
|
const matchWithTest = [];
|
|
13710
|
-
for (const tag of
|
|
13710
|
+
for (const tag of schema3.tags) {
|
|
13711
13711
|
if (!tag.collection && tag.tag === tagName) {
|
|
13712
13712
|
if (tag.default && tag.test)
|
|
13713
13713
|
matchWithTest.push(tag);
|
|
@@ -13718,18 +13718,18 @@ var require_compose_scalar = __commonJS({
|
|
|
13718
13718
|
for (const tag of matchWithTest)
|
|
13719
13719
|
if (tag.test?.test(value))
|
|
13720
13720
|
return tag;
|
|
13721
|
-
const kt =
|
|
13721
|
+
const kt = schema3.knownTags[tagName];
|
|
13722
13722
|
if (kt && !kt.collection) {
|
|
13723
|
-
|
|
13723
|
+
schema3.tags.push(Object.assign({}, kt, { default: false, test: void 0 }));
|
|
13724
13724
|
return kt;
|
|
13725
13725
|
}
|
|
13726
13726
|
onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
|
|
13727
|
-
return
|
|
13727
|
+
return schema3[identity.SCALAR];
|
|
13728
13728
|
}
|
|
13729
|
-
function findScalarTagByTest({ atKey, directives, schema:
|
|
13730
|
-
const tag =
|
|
13731
|
-
if (
|
|
13732
|
-
const compat =
|
|
13729
|
+
function findScalarTagByTest({ atKey, directives, schema: schema3 }, value, token, onError) {
|
|
13730
|
+
const tag = schema3.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema3[identity.SCALAR];
|
|
13731
|
+
if (schema3.compat) {
|
|
13732
|
+
const compat = schema3.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema3[identity.SCALAR];
|
|
13733
13733
|
if (tag.tag !== compat.tag) {
|
|
13734
13734
|
const ts = directives.tagString(tag.tag);
|
|
13735
13735
|
const cs = directives.tagString(compat.tag);
|
|
@@ -19379,14 +19379,14 @@ var TemplateValidationError = class {
|
|
|
19379
19379
|
|
|
19380
19380
|
// ../workflow-parser/dist/templates/template-context.js
|
|
19381
19381
|
var TemplateContext = class {
|
|
19382
|
-
constructor(errors,
|
|
19382
|
+
constructor(errors, schema3, trace) {
|
|
19383
19383
|
this._fileIds = {};
|
|
19384
19384
|
this._fileNames = [];
|
|
19385
19385
|
this.expressionFunctions = [];
|
|
19386
19386
|
this.expressionNamedContexts = [];
|
|
19387
19387
|
this.state = {};
|
|
19388
19388
|
this.errors = errors;
|
|
19389
|
-
this.schema =
|
|
19389
|
+
this.schema = schema3;
|
|
19390
19390
|
this.trace = trace;
|
|
19391
19391
|
}
|
|
19392
19392
|
error(tokenOrFileId, err, tokenRange) {
|
|
@@ -19909,9 +19909,6 @@ function isScalar(t) {
|
|
|
19909
19909
|
function isString(t) {
|
|
19910
19910
|
return isLiteral(t) && t.templateTokenType === TokenType2.String;
|
|
19911
19911
|
}
|
|
19912
|
-
function isNumber(t) {
|
|
19913
|
-
return isLiteral(t) && t.templateTokenType === TokenType2.Number;
|
|
19914
|
-
}
|
|
19915
19912
|
function isBoolean(t) {
|
|
19916
19913
|
return isLiteral(t) && t.templateTokenType === TokenType2.Boolean;
|
|
19917
19914
|
}
|
|
@@ -20723,11 +20720,11 @@ var MappingDefinition = class extends Definition {
|
|
|
20723
20720
|
get definitionType() {
|
|
20724
20721
|
return DefinitionType.Mapping;
|
|
20725
20722
|
}
|
|
20726
|
-
validate(
|
|
20723
|
+
validate(schema3, name) {
|
|
20727
20724
|
if (this.looseKeyType) {
|
|
20728
|
-
|
|
20725
|
+
schema3.getDefinition(this.looseKeyType);
|
|
20729
20726
|
if (this.looseValueType) {
|
|
20730
|
-
|
|
20727
|
+
schema3.getDefinition(this.looseValueType);
|
|
20731
20728
|
} else {
|
|
20732
20729
|
throw new Error(`Property '${LOOSE_KEY_TYPE}' is defined but '${LOOSE_VALUE_TYPE}' is not defined on '${name}'`);
|
|
20733
20730
|
}
|
|
@@ -20739,7 +20736,7 @@ var MappingDefinition = class extends Definition {
|
|
|
20739
20736
|
if (!propertyDef.type) {
|
|
20740
20737
|
throw new Error(`Type not specified for the property '${propertyName}' on '${name}'`);
|
|
20741
20738
|
}
|
|
20742
|
-
|
|
20739
|
+
schema3.getDefinition(propertyDef.type);
|
|
20743
20740
|
}
|
|
20744
20741
|
}
|
|
20745
20742
|
};
|
|
@@ -20852,7 +20849,7 @@ var OneOfDefinition = class extends Definition {
|
|
|
20852
20849
|
get definitionType() {
|
|
20853
20850
|
return DefinitionType.OneOf;
|
|
20854
20851
|
}
|
|
20855
|
-
validate(
|
|
20852
|
+
validate(schema3, name) {
|
|
20856
20853
|
if (this.oneOf.length === 0) {
|
|
20857
20854
|
throw new Error(`'${name}' does not contain any references`);
|
|
20858
20855
|
}
|
|
@@ -20870,7 +20867,7 @@ var OneOfDefinition = class extends Definition {
|
|
|
20870
20867
|
throw new Error(`'${name}' contains duplicate nested type '${nestedType}'`);
|
|
20871
20868
|
}
|
|
20872
20869
|
seenNestedTypes[nestedType] = true;
|
|
20873
|
-
const nestedDefinition =
|
|
20870
|
+
const nestedDefinition = schema3.getDefinition(nestedType);
|
|
20874
20871
|
if (nestedDefinition.readerContext.length > 0) {
|
|
20875
20872
|
throw new Error(`'${name}' is a one-of definition and references another definition that defines context. This is currently not supported.`);
|
|
20876
20873
|
}
|
|
@@ -20988,11 +20985,11 @@ var SequenceDefinition = class extends Definition {
|
|
|
20988
20985
|
get definitionType() {
|
|
20989
20986
|
return DefinitionType.Sequence;
|
|
20990
20987
|
}
|
|
20991
|
-
validate(
|
|
20988
|
+
validate(schema3, name) {
|
|
20992
20989
|
if (!this.itemType) {
|
|
20993
20990
|
throw new Error(`'${name}' does not defined '${ITEM_TYPE}'`);
|
|
20994
20991
|
}
|
|
20995
|
-
|
|
20992
|
+
schema3.getDefinition(this.itemType);
|
|
20996
20993
|
}
|
|
20997
20994
|
};
|
|
20998
20995
|
|
|
@@ -21276,24 +21273,24 @@ var TemplateSchema = class _TemplateSchema {
|
|
|
21276
21273
|
const template = readTemplate(context, TEMPLATE_SCHEMA, objectReader, void 0);
|
|
21277
21274
|
context.errors.check();
|
|
21278
21275
|
const mapping = template.assertMapping(TEMPLATE_SCHEMA);
|
|
21279
|
-
const
|
|
21280
|
-
|
|
21281
|
-
return
|
|
21276
|
+
const schema3 = new _TemplateSchema(mapping);
|
|
21277
|
+
schema3.validate();
|
|
21278
|
+
return schema3;
|
|
21282
21279
|
}
|
|
21283
21280
|
/**
|
|
21284
21281
|
* Gets the internal schema used for reading user-defined schema files
|
|
21285
21282
|
*/
|
|
21286
21283
|
static getInternalSchema() {
|
|
21287
21284
|
if (_TemplateSchema._internalSchema === void 0) {
|
|
21288
|
-
const
|
|
21285
|
+
const schema3 = new _TemplateSchema();
|
|
21289
21286
|
let mappingDefinition = new MappingDefinition(TEMPLATE_SCHEMA);
|
|
21290
21287
|
mappingDefinition.properties[VERSION] = new PropertyDefinition(new StringToken(void 0, void 0, NON_EMPTY_STRING, void 0));
|
|
21291
21288
|
mappingDefinition.properties[DEFINITIONS] = new PropertyDefinition(new StringToken(void 0, void 0, DEFINITIONS, void 0));
|
|
21292
|
-
|
|
21289
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21293
21290
|
mappingDefinition = new MappingDefinition(DEFINITIONS);
|
|
21294
21291
|
mappingDefinition.looseKeyType = NON_EMPTY_STRING;
|
|
21295
21292
|
mappingDefinition.looseValueType = DEFINITION;
|
|
21296
|
-
|
|
21293
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21297
21294
|
let oneOfDefinition = new OneOfDefinition(DEFINITION);
|
|
21298
21295
|
oneOfDefinition.oneOf.push(NULL_DEFINITION);
|
|
21299
21296
|
oneOfDefinition.oneOf.push(BOOLEAN_DEFINITION);
|
|
@@ -21302,84 +21299,84 @@ var TemplateSchema = class _TemplateSchema {
|
|
|
21302
21299
|
oneOfDefinition.oneOf.push(SEQUENCE_DEFINITION);
|
|
21303
21300
|
oneOfDefinition.oneOf.push(MAPPING_DEFINITION);
|
|
21304
21301
|
oneOfDefinition.oneOf.push(ONE_OF_DEFINITION);
|
|
21305
|
-
|
|
21302
|
+
schema3.definitions[oneOfDefinition.key] = oneOfDefinition;
|
|
21306
21303
|
mappingDefinition = new MappingDefinition(NULL_DEFINITION);
|
|
21307
21304
|
mappingDefinition.properties[DESCRIPTION] = new PropertyDefinition(new StringToken(void 0, void 0, STRING, void 0));
|
|
21308
21305
|
mappingDefinition.properties[CONTEXT] = new PropertyDefinition(new StringToken(void 0, void 0, SEQUENCE_OF_NON_EMPTY_STRING, void 0));
|
|
21309
21306
|
mappingDefinition.properties[NULL] = new PropertyDefinition(new StringToken(void 0, void 0, NULL_DEFINITION_PROPERTIES, void 0));
|
|
21310
|
-
|
|
21307
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21311
21308
|
mappingDefinition = new MappingDefinition(NULL_DEFINITION_PROPERTIES);
|
|
21312
|
-
|
|
21309
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21313
21310
|
mappingDefinition = new MappingDefinition(BOOLEAN_DEFINITION);
|
|
21314
21311
|
mappingDefinition.properties[DESCRIPTION] = new PropertyDefinition(new StringToken(void 0, void 0, STRING, void 0));
|
|
21315
21312
|
mappingDefinition.properties[CONTEXT] = new PropertyDefinition(new StringToken(void 0, void 0, SEQUENCE_OF_NON_EMPTY_STRING, void 0));
|
|
21316
21313
|
mappingDefinition.properties[BOOLEAN] = new PropertyDefinition(new StringToken(void 0, void 0, BOOLEAN_DEFINITION_PROPERTIES, void 0));
|
|
21317
|
-
|
|
21314
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21318
21315
|
mappingDefinition = new MappingDefinition(BOOLEAN_DEFINITION_PROPERTIES);
|
|
21319
|
-
|
|
21316
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21320
21317
|
mappingDefinition = new MappingDefinition(NUMBER_DEFINITION);
|
|
21321
21318
|
mappingDefinition.properties[DESCRIPTION] = new PropertyDefinition(new StringToken(void 0, void 0, STRING, void 0));
|
|
21322
21319
|
mappingDefinition.properties[CONTEXT] = new PropertyDefinition(new StringToken(void 0, void 0, SEQUENCE_OF_NON_EMPTY_STRING, void 0));
|
|
21323
21320
|
mappingDefinition.properties[NUMBER] = new PropertyDefinition(new StringToken(void 0, void 0, NUMBER_DEFINITION_PROPERTIES, void 0));
|
|
21324
|
-
|
|
21321
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21325
21322
|
mappingDefinition = new MappingDefinition(NUMBER_DEFINITION_PROPERTIES);
|
|
21326
|
-
|
|
21323
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21327
21324
|
mappingDefinition = new MappingDefinition(STRING_DEFINITION);
|
|
21328
21325
|
mappingDefinition.properties[DESCRIPTION] = new PropertyDefinition(new StringToken(void 0, void 0, STRING, void 0));
|
|
21329
21326
|
mappingDefinition.properties[CONTEXT] = new PropertyDefinition(new StringToken(void 0, void 0, SEQUENCE_OF_NON_EMPTY_STRING, void 0));
|
|
21330
21327
|
mappingDefinition.properties[STRING] = new PropertyDefinition(new StringToken(void 0, void 0, STRING_DEFINITION_PROPERTIES, void 0));
|
|
21331
|
-
|
|
21328
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21332
21329
|
mappingDefinition = new MappingDefinition(STRING_DEFINITION_PROPERTIES);
|
|
21333
21330
|
mappingDefinition.properties[CONSTANT] = new PropertyDefinition(new StringToken(void 0, void 0, NON_EMPTY_STRING, void 0));
|
|
21334
21331
|
mappingDefinition.properties[IGNORE_CASE] = new PropertyDefinition(new StringToken(void 0, void 0, BOOLEAN, void 0));
|
|
21335
21332
|
mappingDefinition.properties[REQUIRE_NON_EMPTY] = new PropertyDefinition(new StringToken(void 0, void 0, BOOLEAN, void 0));
|
|
21336
21333
|
mappingDefinition.properties[IS_EXPRESSION] = new PropertyDefinition(new StringToken(void 0, void 0, BOOLEAN, void 0));
|
|
21337
|
-
|
|
21334
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21338
21335
|
mappingDefinition = new MappingDefinition(SEQUENCE_DEFINITION);
|
|
21339
21336
|
mappingDefinition.properties[DESCRIPTION] = new PropertyDefinition(new StringToken(void 0, void 0, STRING, void 0));
|
|
21340
21337
|
mappingDefinition.properties[CONTEXT] = new PropertyDefinition(new StringToken(void 0, void 0, SEQUENCE_OF_NON_EMPTY_STRING, void 0));
|
|
21341
21338
|
mappingDefinition.properties[SEQUENCE] = new PropertyDefinition(new StringToken(void 0, void 0, SEQUENCE_DEFINITION_PROPERTIES, void 0));
|
|
21342
|
-
|
|
21339
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21343
21340
|
mappingDefinition = new MappingDefinition(SEQUENCE_DEFINITION_PROPERTIES);
|
|
21344
21341
|
mappingDefinition.properties[ITEM_TYPE] = new PropertyDefinition(new StringToken(void 0, void 0, NON_EMPTY_STRING, void 0));
|
|
21345
|
-
|
|
21342
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21346
21343
|
mappingDefinition = new MappingDefinition(MAPPING_DEFINITION);
|
|
21347
21344
|
mappingDefinition.properties[DESCRIPTION] = new PropertyDefinition(new StringToken(void 0, void 0, STRING, void 0));
|
|
21348
21345
|
mappingDefinition.properties[CONTEXT] = new PropertyDefinition(new StringToken(void 0, void 0, SEQUENCE_OF_NON_EMPTY_STRING, void 0));
|
|
21349
21346
|
mappingDefinition.properties[MAPPING] = new PropertyDefinition(new StringToken(void 0, void 0, MAPPING_DEFINITION_PROPERTIES, void 0));
|
|
21350
|
-
|
|
21347
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21351
21348
|
mappingDefinition = new MappingDefinition(MAPPING_DEFINITION_PROPERTIES);
|
|
21352
21349
|
mappingDefinition.properties[PROPERTIES] = new PropertyDefinition(new StringToken(void 0, void 0, PROPERTIES, void 0));
|
|
21353
21350
|
mappingDefinition.properties[LOOSE_KEY_TYPE] = new PropertyDefinition(new StringToken(void 0, void 0, NON_EMPTY_STRING, void 0));
|
|
21354
21351
|
mappingDefinition.properties[LOOSE_VALUE_TYPE] = new PropertyDefinition(new StringToken(void 0, void 0, NON_EMPTY_STRING, void 0));
|
|
21355
|
-
|
|
21352
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21356
21353
|
mappingDefinition = new MappingDefinition(PROPERTIES);
|
|
21357
21354
|
mappingDefinition.looseKeyType = NON_EMPTY_STRING;
|
|
21358
21355
|
mappingDefinition.looseValueType = PROPERTY_VALUE;
|
|
21359
|
-
|
|
21356
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21360
21357
|
oneOfDefinition = new OneOfDefinition(PROPERTY_VALUE);
|
|
21361
21358
|
oneOfDefinition.oneOf.push(NON_EMPTY_STRING);
|
|
21362
21359
|
oneOfDefinition.oneOf.push(MAPPING_PROPERTY_VALUE);
|
|
21363
|
-
|
|
21360
|
+
schema3.definitions[oneOfDefinition.key] = oneOfDefinition;
|
|
21364
21361
|
mappingDefinition = new MappingDefinition(MAPPING_PROPERTY_VALUE);
|
|
21365
21362
|
mappingDefinition.properties[TYPE] = new PropertyDefinition(new StringToken(void 0, void 0, NON_EMPTY_STRING, void 0));
|
|
21366
21363
|
mappingDefinition.properties[REQUIRED] = new PropertyDefinition(new StringToken(void 0, void 0, BOOLEAN, void 0));
|
|
21367
21364
|
mappingDefinition.properties[DESCRIPTION] = new PropertyDefinition(new StringToken(void 0, void 0, STRING, void 0));
|
|
21368
|
-
|
|
21365
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21369
21366
|
mappingDefinition = new MappingDefinition(ONE_OF_DEFINITION);
|
|
21370
21367
|
mappingDefinition.properties[DESCRIPTION] = new PropertyDefinition(new StringToken(void 0, void 0, STRING, void 0));
|
|
21371
21368
|
mappingDefinition.properties[CONTEXT] = new PropertyDefinition(new StringToken(void 0, void 0, SEQUENCE_OF_NON_EMPTY_STRING, void 0));
|
|
21372
21369
|
mappingDefinition.properties[ONE_OF] = new PropertyDefinition(new StringToken(void 0, void 0, SEQUENCE_OF_NON_EMPTY_STRING, void 0));
|
|
21373
21370
|
mappingDefinition.properties[ALLOWED_VALUES] = new PropertyDefinition(new StringToken(void 0, void 0, SEQUENCE_OF_NON_EMPTY_STRING, void 0));
|
|
21374
|
-
|
|
21371
|
+
schema3.definitions[mappingDefinition.key] = mappingDefinition;
|
|
21375
21372
|
const stringDefinition = new StringDefinition(NON_EMPTY_STRING);
|
|
21376
21373
|
stringDefinition.requireNonEmpty = true;
|
|
21377
|
-
|
|
21374
|
+
schema3.definitions[stringDefinition.key] = stringDefinition;
|
|
21378
21375
|
const sequenceDefinition = new SequenceDefinition(SEQUENCE_OF_NON_EMPTY_STRING);
|
|
21379
21376
|
sequenceDefinition.itemType = NON_EMPTY_STRING;
|
|
21380
|
-
|
|
21381
|
-
|
|
21382
|
-
_TemplateSchema._internalSchema =
|
|
21377
|
+
schema3.definitions[sequenceDefinition.key] = sequenceDefinition;
|
|
21378
|
+
schema3.validate();
|
|
21379
|
+
_TemplateSchema._internalSchema = schema3;
|
|
21383
21380
|
}
|
|
21384
21381
|
return _TemplateSchema._internalSchema;
|
|
21385
21382
|
}
|
|
@@ -23066,11 +23063,88 @@ function getOptionsWithDefaults(options) {
|
|
|
23066
23063
|
};
|
|
23067
23064
|
}
|
|
23068
23065
|
|
|
23066
|
+
// ../workflow-parser/dist/action-v1.0.min.json
|
|
23067
|
+
var action_v1_0_min_default = { definitions: { "action-root": { description: "Action file", mapping: { properties: { name: "string", description: "string", inputs: "inputs", outputs: "outputs", runs: "runs" }, "loose-key-type": "non-empty-string", "loose-value-type": "any" } }, "action-root-strict": { description: "GitHub Action manifest file (action.yml/action.yaml) that defines an action's metadata, inputs, outputs, and execution configuration.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions)", mapping: { properties: { name: { type: "non-empty-string", required: true, description: "The name of your action. GitHub displays the name in the Actions tab to help visually identify actions in each job.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#name)" }, description: { type: "string", required: true, description: "A short description of the action. GitHub displays this description in the Actions Marketplace.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#description)" }, author: { type: "string", description: "The name of the action's author.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#author)" }, inputs: "inputs-strict", outputs: "outputs", runs: { type: "runs-strict", required: true }, branding: "branding" } } }, inputs: { mapping: { "loose-key-type": "non-empty-string", "loose-value-type": "input" } }, "inputs-strict": { description: "Input parameters allow you to specify data that the action expects to use during runtime. GitHub stores input parameters as environment variables. Inputs ids with uppercase letters are converted to lowercase during runtime.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#inputs)", mapping: { "loose-key-type": "non-empty-string", "loose-value-type": "input-strict" } }, input: { mapping: { properties: { default: "input-default-context" }, "loose-key-type": "non-empty-string", "loose-value-type": "any" } }, "input-strict": { description: "An input parameter for this action.", mapping: { properties: { description: { type: "string", description: "A string description of the input parameter.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_iddescription)" }, required: { type: "boolean", description: "A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_idrequired)" }, default: { type: "input-default-context", description: "A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_iddefault)" }, deprecationMessage: { type: "string", description: "A string shown to users using the deprecated input, warning them that the input is deprecated and mentioning any alternatives.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_iddeprecationmessage)" } }, "loose-key-type": "non-empty-string", "loose-value-type": "any" } }, "input-default-context": { description: "A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_iddefault)", context: ["github", "strategy", "matrix", "job", "runner", "hashFiles(1,255)"], string: {} }, outputs: { description: "Output parameters allow you to declare data that an action sets. Actions that run later in a workflow can use the output data set in previously run actions.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#outputs-for-composite-actions)", mapping: { "loose-key-type": "non-empty-string", "loose-value-type": "output-definition" } }, "output-definition": { description: "An output parameter for this action.", mapping: { properties: { description: { type: "string", description: "A string description of the output parameter.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_iddescription)" }, value: { type: "output-value", description: "The value that the output parameter will be mapped to. You can set this to a string or an expression with context.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_idvalue)" } } } }, "output-value": { description: "The value that the output parameter will be mapped to. You can set this to a string or an expression with context.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_idvalue)", context: ["github", "strategy", "matrix", "steps", "inputs", "job", "runner", "env"], string: {} }, runs: { "one-of": ["container-runs", "node-runs", "composite-runs", "plugin-runs"] }, "runs-strict": { description: "Specifies whether this is a JavaScript action, a composite action, or a Docker container action and how the action is executed.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runs)", "one-of": ["container-runs-strict", "node-runs-strict", "composite-runs-strict"] }, "plugin-runs": { mapping: { properties: { plugin: "non-empty-string" } } }, "container-runs": { mapping: { properties: { using: "non-empty-string", image: "non-empty-string", entrypoint: "non-empty-string", args: "container-runs-args", env: "container-runs-env", "pre-entrypoint": "non-empty-string", "pre-if": "non-empty-string", "post-entrypoint": "non-empty-string", "post-if": "non-empty-string" } } }, "container-runs-args": { description: "An array of strings that define the inputs for a Docker container. Inputs can include hardcoded strings. GitHub passes the args to the container's ENTRYPOINT when the container starts up.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsargs)", sequence: { "item-type": "container-runs-context" } }, "container-runs-env": { description: "Specifies a key/value map of environment variables to set in the container environment.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsenv)", context: ["inputs"], mapping: { "loose-key-type": "non-empty-string", "loose-value-type": "string" } }, "container-runs-context": { context: ["inputs"], string: {} }, "node-runs": { mapping: { properties: { using: "non-empty-string", main: "non-empty-string", pre: "non-empty-string", "pre-if": "non-empty-string", post: "non-empty-string", "post-if": "non-empty-string" } } }, "composite-runs": { mapping: { properties: { using: "non-empty-string", steps: "composite-steps" } } }, "container-runs-strict": { description: "Configuration for Docker container actions.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runs)", mapping: { properties: { using: { type: "using", required: true, description: "The runtime used to execute the action. Must be docker for Docker container actions.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsusing)" }, image: { type: "non-empty-string", required: true, description: "The Docker image to use as the container to run the action. The value can be the Docker base image name, a local Dockerfile in your repository, or a public image in Docker Hub or another registry.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsimage)" }, entrypoint: { type: "non-empty-string", description: "Overrides the Docker ENTRYPOINT in the Dockerfile, or sets it if one wasn't already specified.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsentrypoint)" }, args: "container-runs-args", env: "container-runs-env", "pre-entrypoint": { type: "non-empty-string", description: "Allows you to run a script before the entrypoint action begins.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspre-entrypoint)" }, "pre-if": { type: "non-empty-string", description: "Allows you to define conditions for the pre: action execution. The pre: action will only run if the conditions in pre-if are met. If not set, then pre-if defaults to always().\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspre-if)" }, "post-entrypoint": { type: "non-empty-string", description: "Allows you to run a cleanup script once the runs.entrypoint action has completed.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspost-entrypoint)" }, "post-if": { type: "non-empty-string", description: "Allows you to define conditions for the post: action execution. The post: action will only run if the conditions in post-if are met. If not set, then post-if defaults to always().\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspost-if)" } } } }, "node-runs-strict": { description: "Configuration for JavaScript actions executed with Node.js.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runs)", mapping: { properties: { using: { type: "using", required: true, description: "The runtime used to execute the action. Use node20 or node24 for JavaScript actions.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsusing)" }, main: { type: "non-empty-string", description: "The file that contains your action code. The runtime specified in using executes this file.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsmain)" }, pre: { type: "non-empty-string", description: "Allows you to run a script at the start of a job, before the main: action begins. You can use pre: to run prerequisite setup scripts.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspre)" }, "pre-if": { type: "non-empty-string", description: "Allows you to define conditions for the pre: action execution. The pre: action will only run if the conditions in pre-if are met. If not set, then pre-if defaults to always().\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspre-if)" }, post: { type: "non-empty-string", description: "Allows you to run a script at the end of a job, once the main: action has completed. You can use post: to run cleanup scripts.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspost)" }, "post-if": { type: "non-empty-string", description: "Allows you to define conditions for the post: action execution. The post: action will only run if the conditions in post-if are met. If not set, then post-if defaults to always().\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspost-if)" } } } }, "composite-runs-strict": { description: "Configuration for composite actions that run multiple steps.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runs)", mapping: { properties: { using: { type: "using", required: true, description: "The runtime used to execute the action. Must be composite for composite actions.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsusing)" }, steps: { type: "composite-steps", required: true } } } }, "composite-steps": { description: "The steps that you plan to run in this action. These can be either run steps or uses steps.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runssteps)", sequence: { "item-type": "composite-step" } }, "composite-step": { description: "A step within a composite action.", "one-of": ["run-step", "uses-step"] }, "run-step": { description: "Runs a command-line program using the operating system's shell.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsrun)", mapping: { properties: { name: { type: "string-steps-context", description: "A name for your step to display on GitHub.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsname)" }, id: { type: "non-empty-string", description: "A unique identifier for the step. You can use the id to reference the step in contexts.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsid)" }, if: { type: "step-if", description: "You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsif)" }, run: { type: "string-steps-context", required: true, description: "The command you want to run. This can be inline or a script in your action repository.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsrun)" }, shell: { type: "string-steps-context", required: true, description: "The shell where you want to run the command. Any shell supported by the runner can be used. Required if run is set.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsshell)" }, env: "step-env", "continue-on-error": { type: "boolean-steps-context", description: "Prevents the action from failing when a step fails. Set to true to allow the action to pass when this step fails.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepscontinue-on-error)" }, "working-directory": { type: "string-steps-context", description: "Specifies the working directory where the command is run.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsworking-directory)" } } } }, "uses-step": { description: "Runs another action as part of a step in your action.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsuses)", mapping: { properties: { name: { type: "string-steps-context", description: "A name for your step to display on GitHub.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsname)" }, id: { type: "non-empty-string", description: "A unique identifier for the step. You can use the id to reference the step in contexts.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsid)" }, if: { type: "step-if", description: "You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsif)" }, uses: { type: "non-empty-string", required: true, description: "Selects an action to run as part of a step in your action. An action is a reusable unit of code.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsuses)" }, with: "step-with", env: "step-env", "continue-on-error": { type: "boolean-steps-context", description: "Prevents the action from failing when a step fails. Set to true to allow the action to pass when this step fails.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepscontinue-on-error)" } } } }, "string-steps-context": { context: ["github", "inputs", "strategy", "matrix", "steps", "job", "runner", "env", "hashFiles(1,255)"], string: {} }, "boolean-steps-context": { context: ["github", "inputs", "strategy", "matrix", "steps", "job", "runner", "env", "hashFiles(1,255)"], boolean: {} }, "step-env": { description: "Sets variables for steps to use in the runner environment. You can also set variables for the entire action.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsenv)", context: ["github", "inputs", "strategy", "matrix", "steps", "job", "runner", "env", "hashFiles(1,255)"], mapping: { "loose-key-type": "non-empty-string", "loose-value-type": "string" } }, "step-if": { description: "You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsif)", context: ["github", "inputs", "strategy", "matrix", "steps", "job", "runner", "env", "always(0,0)", "failure(0,0)", "cancelled(0,0)", "success(0,0)", "hashFiles(1,255)"], string: {} }, "step-with": { description: "A map of the input parameters defined by the action. Each input parameter is a key/value pair.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepswith)", context: ["github", "inputs", "strategy", "matrix", "steps", "job", "runner", "env", "hashFiles(1,255)"], mapping: { "loose-key-type": "non-empty-string", "loose-value-type": "string" } }, branding: { description: "You can use a color and Feather icon to create a badge to personalize and distinguish your action in GitHub Marketplace.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#branding)", mapping: { properties: { icon: { type: "branding-icon", description: "The name of the v4.28.0 Feather icon to use.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#brandingicon)" }, color: { type: "branding-color", description: "The background color of the badge.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#brandingcolor)" } } } }, "branding-icon": { description: "The name of the v4.28.0 Feather icon to use. Brand icons are omitted as well as: coffee, columns, divide-circle, divide-square, divide, frown, hexagon, key, meh, mouse-pointer, smile, tool, x-octagon.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#brandingicon)", "allowed-values": ["activity", "airplay", "alert-circle", "alert-octagon", "alert-triangle", "align-center", "align-justify", "align-left", "align-right", "anchor", "aperture", "archive", "arrow-down-circle", "arrow-down-left", "arrow-down-right", "arrow-down", "arrow-left-circle", "arrow-left", "arrow-right-circle", "arrow-right", "arrow-up-circle", "arrow-up-left", "arrow-up-right", "arrow-up", "at-sign", "award", "bar-chart-2", "bar-chart", "battery-charging", "battery", "bell-off", "bell", "bluetooth", "bold", "book-open", "book", "bookmark", "box", "briefcase", "calendar", "camera-off", "camera", "cast", "check-circle", "check-square", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "chevrons-down", "chevrons-left", "chevrons-right", "chevrons-up", "circle", "clipboard", "clock", "cloud-drizzle", "cloud-lightning", "cloud-off", "cloud-rain", "cloud-snow", "cloud", "code", "command", "compass", "copy", "corner-down-left", "corner-down-right", "corner-left-down", "corner-left-up", "corner-right-down", "corner-right-up", "corner-up-left", "corner-up-right", "cpu", "credit-card", "crop", "crosshair", "database", "delete", "disc", "dollar-sign", "download-cloud", "download", "droplet", "edit-2", "edit-3", "edit", "external-link", "eye-off", "eye", "fast-forward", "feather", "file-minus", "file-plus", "file-text", "file", "film", "filter", "flag", "folder-minus", "folder-plus", "folder", "gift", "git-branch", "git-commit", "git-merge", "git-pull-request", "globe", "grid", "hard-drive", "hash", "headphones", "heart", "help-circle", "home", "image", "inbox", "info", "italic", "layers", "layout", "life-buoy", "link-2", "link", "list", "loader", "lock", "log-in", "log-out", "mail", "map-pin", "map", "maximize-2", "maximize", "menu", "message-circle", "message-square", "mic-off", "mic", "minimize-2", "minimize", "minus-circle", "minus-square", "minus", "monitor", "moon", "more-horizontal", "more-vertical", "move", "music", "navigation-2", "navigation", "octagon", "package", "paperclip", "pause-circle", "pause", "percent", "phone-call", "phone-forwarded", "phone-incoming", "phone-missed", "phone-off", "phone-outgoing", "phone", "pie-chart", "play-circle", "play", "plus-circle", "plus-square", "plus", "pocket", "power", "printer", "radio", "refresh-ccw", "refresh-cw", "repeat", "rewind", "rotate-ccw", "rotate-cw", "rss", "save", "scissors", "search", "send", "server", "settings", "share-2", "share", "shield-off", "shield", "shopping-bag", "shopping-cart", "shuffle", "sidebar", "skip-back", "skip-forward", "slash", "sliders", "smartphone", "speaker", "square", "star", "stop-circle", "sun", "sunrise", "sunset", "tablet", "tag", "target", "terminal", "thermometer", "thumbs-down", "thumbs-up", "toggle-left", "toggle-right", "trash-2", "trash", "trending-down", "trending-up", "triangle", "truck", "tv", "type", "umbrella", "underline", "unlock", "upload-cloud", "upload", "user-check", "user-minus", "user-plus", "user-x", "user", "users", "video-off", "video", "voicemail", "volume-1", "volume-2", "volume-x", "volume", "watch", "wifi-off", "wifi", "wind", "x-circle", "x-square", "x", "zap-off", "zap", "zoom-in", "zoom-out"] }, "branding-color": { description: "The background color of the badge.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#brandingcolor)", "allowed-values": ["white", "yellow", "blue", "green", "orange", "red", "purple", "gray-dark"] }, using: { description: "The runtime used to execute the action.", "allowed-values": ["docker", "node12", "node16", "node20", "node24", "composite"] }, "non-empty-string": { string: { "require-non-empty": true } } } };
|
|
23068
|
+
|
|
23069
|
+
// ../workflow-parser/dist/actions/action-schema.js
|
|
23070
|
+
var schema2;
|
|
23071
|
+
function getActionSchema() {
|
|
23072
|
+
if (schema2 === void 0) {
|
|
23073
|
+
const json = JSON.stringify(action_v1_0_min_default);
|
|
23074
|
+
schema2 = TemplateSchema.load(new JSONObjectReader(void 0, json));
|
|
23075
|
+
}
|
|
23076
|
+
return schema2;
|
|
23077
|
+
}
|
|
23078
|
+
|
|
23069
23079
|
// ../languageservice/dist/complete.js
|
|
23070
23080
|
var import_vscode_languageserver_types = __toESM(require_main2(), 1);
|
|
23071
23081
|
|
|
23082
|
+
// ../languageservice/dist/context/action-context.js
|
|
23083
|
+
function getActionContext(uri, template, tokenPath) {
|
|
23084
|
+
const context = { uri, template };
|
|
23085
|
+
if (!template) {
|
|
23086
|
+
return context;
|
|
23087
|
+
}
|
|
23088
|
+
if (template.runs?.using !== "composite") {
|
|
23089
|
+
return context;
|
|
23090
|
+
}
|
|
23091
|
+
const compositeRuns = template.runs;
|
|
23092
|
+
if (!compositeRuns.steps?.length) {
|
|
23093
|
+
return context;
|
|
23094
|
+
}
|
|
23095
|
+
let stepsSequence;
|
|
23096
|
+
let stepToken;
|
|
23097
|
+
for (const token of tokenPath) {
|
|
23098
|
+
const defKey = token.definition?.key;
|
|
23099
|
+
if (defKey === "composite-steps" && token instanceof SequenceToken) {
|
|
23100
|
+
stepsSequence = token;
|
|
23101
|
+
} else if ((defKey === "run-step" || defKey === "uses-step") && isMapping(token)) {
|
|
23102
|
+
stepToken = token;
|
|
23103
|
+
}
|
|
23104
|
+
}
|
|
23105
|
+
if (stepsSequence && stepToken) {
|
|
23106
|
+
context.step = findStep(compositeRuns.steps, stepsSequence, stepToken);
|
|
23107
|
+
}
|
|
23108
|
+
return context;
|
|
23109
|
+
}
|
|
23110
|
+
function findStep(steps, stepsSequence, stepToken) {
|
|
23111
|
+
let stepIndex = -1;
|
|
23112
|
+
for (let i = 0; i < stepsSequence.count; i++) {
|
|
23113
|
+
if (stepsSequence.get(i) === stepToken) {
|
|
23114
|
+
stepIndex = i;
|
|
23115
|
+
break;
|
|
23116
|
+
}
|
|
23117
|
+
}
|
|
23118
|
+
if (stepIndex === -1 || stepIndex >= steps.length) {
|
|
23119
|
+
return void 0;
|
|
23120
|
+
}
|
|
23121
|
+
return steps[stepIndex];
|
|
23122
|
+
}
|
|
23123
|
+
function getActionInputs(template) {
|
|
23124
|
+
return template?.inputs ?? [];
|
|
23125
|
+
}
|
|
23126
|
+
function getActionStepIdsBefore(context) {
|
|
23127
|
+
const template = context.template;
|
|
23128
|
+
if (!template || template.runs?.using !== "composite") {
|
|
23129
|
+
return [];
|
|
23130
|
+
}
|
|
23131
|
+
const compositeRuns = template.runs;
|
|
23132
|
+
const steps = compositeRuns.steps ?? [];
|
|
23133
|
+
const currentStep = context.step;
|
|
23134
|
+
const stepIds = [];
|
|
23135
|
+
for (const step of steps) {
|
|
23136
|
+
if (currentStep && step === currentStep) {
|
|
23137
|
+
break;
|
|
23138
|
+
}
|
|
23139
|
+
if (step.id) {
|
|
23140
|
+
stepIds.push(step.id);
|
|
23141
|
+
}
|
|
23142
|
+
}
|
|
23143
|
+
return stepIds;
|
|
23144
|
+
}
|
|
23145
|
+
|
|
23072
23146
|
// ../languageservice/dist/context-providers/descriptions.min.json
|
|
23073
|
-
var descriptions_min_default = { $schema: "./descriptionsSchema.json", root: { github: { description: "Information about the workflow run. For more information, see [`github` context](https://docs.github.com/actions/learn-github-actions/contexts#github-context)." }, env: { description: "Contains variables set in a workflow, job, or step. For more information, see [`env` context](https://docs.github.com/actions/learn-github-actions/contexts#env-context)." }, vars: { description: "Contains variables set at the repository, organization, or environment levels. For more information, see [`vars` context](https://docs.github.com/actions/learn-github-actions/contexts#vars-context)." }, job: { description: "Information about the currently running job. For more information, see [`job` context](https://docs.github.com/actions/learn-github-actions/contexts#job-context)." }, jobs: { description: "For reusable workflows only, contains outputs of jobs from the reusable workflow. For more information, see [`jobs` context](https://docs.github.com/actions/learn-github-actions/contexts#jobs-context)." }, steps: { description: "Information about the steps that have been run in the current job. For more information, see [`steps` context](https://docs.github.com/actions/learn-github-actions/contexts#steps-context)." }, runner: { description: "Information about the runner that is running the current job. For more information, see [`runner` context](https://docs.github.com/actions/learn-github-actions/contexts#runner-context)." }, secrets: { description: "Contains the names and values of secrets that are available to a workflow run. For more information, see [`secrets` context](https://docs.github.com/actions/learn-github-actions/contexts#secrets-context)." }, strategy: { description: "Information about the matrix execution strategy for the current job. For more information, see [`strategy` context](https://docs.github.com/actions/learn-github-actions/contexts#strategy-context)." }, matrix: { description: "Contains the matrix properties defined in the workflow that apply to the current job. For more information, see [`matrix` context](https://docs.github.com/actions/learn-github-actions/contexts#matrix-context)." }, needs: { description: "Contains the outputs of all jobs that are defined as a dependency of the current job. For more information, see [`needs` context](https://docs.github.com/actions/learn-github-actions/contexts#needs-context)." }, inputs: { description: "Contains the inputs of a reusable or manually triggered workflow. For more information, see [`inputs` context](https://docs.github.com/actions/learn-github-actions/contexts#inputs-context)." } }, functions: { always: { description: "Causes the step to always execute, and returns `true`, even when canceled. The `always` expression is best used at the step level or on tasks that you expect to run even when a job is canceled. For example, you can use `always` to send logs even when a job is canceled." }, cancelled: { description: "Returns `true` if the workflow was canceled." }, failure: { description: "Returns `true` when any previous step of a job fails. If you have a chain of dependent jobs, `failure()` returns `true` if any ancestor job fails." }, hashFiles: { description: 'Returns a single hash for the set of files that matches the `path` pattern. You can provide a single `path` pattern or multiple `path` patterns separated by commas. The `path` is relative to the `GITHUB_WORKSPACE` directory and can only include files inside of the `GITHUB_WORKSPACE`. This function calculates an individual SHA-256 hash for each matched file, and then uses those hashes to calculate a final SHA-256 hash for the set of files. If the `path` pattern does not match any files, this returns an empty string. For more information about SHA-256, see "[SHA-2](https://wikipedia.org/wiki/SHA-2)."\n\nYou can use pattern matching characters to match file names. Pattern matching is case-insensitive on Windows. For more information about supported pattern matching characters, see "[Workflow syntax for GitHub Actions](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet)."' } }, github: { action: { description: "The name of the action currently running, or the [`id`](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsid) of a step. GitHub removes special characters, and uses the name `__run` when the current step runs a script without an `id`. If you use the same action more than once in the same job, the name will include a suffix with the sequence number with underscore before it. For example, the first script you run will have the name `__run`, and the second script will be named `__run_2`. Similarly, the second invocation of `actions/checkout` will be `actionscheckout2`." }, action_path: { description: "The path where an action is located. This property is only supported in composite actions. You can use this path to access files located in the same repository as the action, for example by changing directories to the path: `cd ${{ github.action_path }}`." }, action_ref: { description: "For a step executing an action, this is the ref of the action being executed. For example, `v2`." }, action_repository: { description: "For a step executing an action, this is the owner and repository name of the action. For example, `actions/checkout`." }, action_status: { description: "For a composite action, the current result of the composite action." }, actor: { description: "The username of the user that triggered the initial workflow run. If the workflow run is a re-run, this value may differ from `github.triggering_actor`. Any workflow re-runs will use the privileges of `github.actor`, even if the actor initiating the re-run (`github.triggering_actor`) has different privileges." }, actor_id: { description: "The account ID of the person or app that triggered the initial workflow run. For example, `1234567`. Note that this is different from the actor username.", versions: { ghes: ">=3.9", ghae: ">=3.9" } }, api_url: { description: "The URL of the GitHub REST API." }, base_ref: { description: "The `base_ref` or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either `pull_request` or `pull_request_target`." }, env: { description: 'Path on the runner to the file that sets environment variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see "[Workflow commands for GitHub Actions](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable)."' }, event: { description: 'The full event webhook payload. You can access individual properties of the event using this context. This object is identical to the webhook payload of the event that triggered the workflow run, and is different for each event. The webhooks for each GitHub Actions event is linked in "[Events that trigger workflows](https://docs.github.com/actions/using-workflows/events-that-trigger-workflows)." For example, for a workflow run triggered by the [`push` event](https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#push), this object contains the contents of the [push webhook payload](https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#push).' }, event_name: { description: "The name of the event that triggered the workflow run." }, event_path: { description: "The path to the file on the runner that contains the full event webhook payload." }, graphql_url: { description: "The URL of the GitHub GraphQL API." }, head_ref: { description: "The `head_ref` or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either `pull_request` or `pull_request_target`." }, job: { description: "The [`job_id`](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_id) of the current job.\nNote: This context property is set by the Actions runner, and is only available within the execution `steps` of a job. Otherwise, the value of this property will be `null`." }, job_workflow_sha: { description: "For jobs using a reusable workflow, the commit SHA for the reusable workflow file.", versions: { ghes: ">=3.9", ghae: ">=3.9" } }, path: { description: 'Path on the runner to the file that sets system PATH variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see "[Workflow commands for GitHub Actions](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path)."' }, ref: { description: "The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by `push`, this is the branch or tag ref that was pushed. For workflows triggered by `pull_request`, this is the pull request merge branch. For workflows triggered by `release`, this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format is `refs/heads/<branch_name>`, for pull requests it is `refs/pull/<pr_number>/merge`, and for tags it is `refs/tags/<tag_name>`. For example, `refs/heads/feature-branch-1`." }, ref_name: { description: "The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, `feature-branch-1`." }, ref_protected: { description: "`true` if branch protections are configured for the ref that triggered the workflow run." }, ref_type: { description: "The type of ref that triggered the workflow run. Valid values are `branch` or `tag`." }, repository: { description: "The owner and repository name. For example, `octocat/Hello-World`." }, repository_id: { description: "The ID of the repository. For example, `123456789`. Note that this is different from the repository name.", versions: { ghes: ">=3.9", ghae: ">=3.9" } }, repository_owner: { description: "The repository owner's username. For example, `octocat`." }, repository_owner_id: { description: "The repository owner's account ID. For example, `1234567`. Note that this is different from the owner's name.", versions: { ghes: ">=3.9", ghae: ">=3.9" } }, repositoryUrl: { description: "The Git URL to the repository. For example, `git://github.com/octocat/hello-world.git`." }, retention_days: { description: "The number of days that workflow run logs and artifacts are kept." }, run_id: { description: "A unique number for each workflow run within a repository. This number does not change if you re-run the workflow run." }, run_number: { description: "A unique number for each run of a particular workflow in a repository. This number begins at 1 for the workflow's first run, and increments with each new run. This number does not change if you re-run the workflow run." }, run_attempt: { description: "A unique number for each attempt of a particular workflow run in a repository. This number begins at 1 for the workflow run's first attempt, and increments with each re-run." }, secret_source: { description: "The source of a secret used in a workflow. Possible values are `None`, `Actions`, `Dependabot`, or `Codespaces`." }, server_url: { description: "The URL of the GitHub server. For example: `https://github.com`." }, sha: { description: 'The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see "[Events that trigger workflows](https://docs.github.com/actions/using-workflows/events-that-trigger-workflows)." For example, `ffac537e6cbbf934b08745a378932722df287a53`.' }, token: { description: 'A token to authenticate on behalf of the GitHub App installed on your repository. This is functionally equivalent to the `GITHUB_TOKEN` secret. For more information, see "[Automatic token authentication](https://docs.github.com/actions/security-guides/automatic-token-authentication)."\nNote: This context property is set by the Actions runner, and is only available within the execution `steps` of a job. Otherwise, the value of this property will be `null`.' }, triggering_actor: { description: "The username of the user that initiated the workflow run. If the workflow run is a re-run, this value may differ from `github.actor`. Any workflow re-runs will use the privileges of `github.actor`, even if the actor initiating the re-run (`github.triggering_actor`) has different privileges." }, workflow: { description: "The name of the workflow. If the workflow file doesn't specify a `name`, the value of this property is the full path of the workflow file in the repository." }, workflow_ref: { description: "The ref path to the workflow. For example, `octocat/hello-world/.github/workflows/my-workflow.yml@refs/heads/my_branch`.", versions: { ghes: ">=3.9", ghae: ">=3.9" } }, workflow_sha: { description: "The commit SHA for the workflow file.", versions: { ghes: ">=3.9", ghae: ">=3.9" } }, workspace: { description: "The default working directory on the runner for steps, and the default location of your repository when using the [`checkout`](https://github.com/actions/checkout) action." } }, secrets: { GITHUB_TOKEN: { description: 'Automatically created token for each workflow run. For more information, see "[Automatic token authentication](https://docs.github.com/actions/security-guides/automatic-token-authentication)."' } }, jobs: { outputs: { description: "The set of outputs of a job in a reusable workflow." }, result: { description: "The result of a job in the reusable workflow. Possible values are `success`, `failure`, `cancelled`, or `skipped`." } }, steps: { outputs: { description: 'The set of outputs defined for the step. For more information, see "[Metadata syntax for GitHub Actions](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#outputs-for-docker-container-and-javascript-actions)."' }, conclusion: { description: "The result of a completed step after [`continue-on-error`](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error) is applied. Possible values are `success`, `failure`, `cancelled`, or `skipped`. When a `continue-on-error` step fails, the `outcome` is `failure`, but the final conclusion is `success`." }, outcome: { description: "The result of a completed step before [`continue-on-error`](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error) is applied. Possible values are `success`, `failure`, `cancelled`, or `skipped`. When a `continue-on-error` step fails, the `outcome` is `failure`, but the final conclusion is `success`." } }, runner: { name: { description: "The name of the runner executing the job." }, os: { description: "The operating system of the runner executing the job. Possible values are `Linux`, `Windows`, or `macOS`." }, arch: { description: "The architecture of the runner executing the job. Possible values are `X86`, `X64`, `ARM`, or `ARM64`." }, temp: { description: "The path to a temporary directory on the runner. This directory is emptied at the beginning and end of each job. Note that files will not be removed if the runner's user account does not have permission to delete them." }, tool_cache: { description: 'The path to the directory containing preinstalled tools for GitHub-hosted runners. For more information, see "[About GitHub-hosted runners](https://docs.github.com/actions/reference/specifications-for-github-hosted-runners/#supported-software)."' }, debug: { description: 'This is set only if [`ACTIONS_STEP_DEBUG`](https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging) is enabled, and always has the value of `"1"`. It can be useful as an indicator to enable additional debugging or verbose logging in your own job steps.' }, environment: { description: "The environment of the runner executing the job. Possible values are `github-hosted` for GitHub-hosted runners, or `self-hosted` for self-hosted runners." }, workspace: { description: "The runner-specific working directory path for the job." } }, strategy: { "fail-fast": { description: 'When `true`, all in-progress jobs are canceled if any job in a matrix fails. For more information, see "[Workflow syntax for GitHub Actions](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast)."' }, "job-index": { description: "The index of the current job in the matrix. **Note:** This number is a zero-based number. The first job's index in the matrix is `0`." }, "job-total": { description: "The total number of jobs in the matrix. **Note:** This number **is not** a zero-based number. For example, for a matrix with four jobs, the value of `job-total` is `4`." }, "max-parallel": { description: 'The maximum number of jobs that can run simultaneously when using a matrix job strategy. For more information, see "[Workflow syntax for GitHub Actions](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymax-parallel)."' } } };
|
|
23147
|
+
var descriptions_min_default = { $schema: "./descriptionsSchema.json", root: { github: { description: "Information about the workflow run. For more information, see [`github` context](https://docs.github.com/actions/learn-github-actions/contexts#github-context)." }, env: { description: "Contains variables set in a workflow, job, or step. For more information, see [`env` context](https://docs.github.com/actions/learn-github-actions/contexts#env-context)." }, vars: { description: "Contains variables set at the repository, organization, or environment levels. For more information, see [`vars` context](https://docs.github.com/actions/learn-github-actions/contexts#vars-context)." }, job: { description: "Information about the currently running job. For more information, see [`job` context](https://docs.github.com/actions/learn-github-actions/contexts#job-context)." }, jobs: { description: "For reusable workflows only, contains outputs of jobs from the reusable workflow. For more information, see [`jobs` context](https://docs.github.com/actions/learn-github-actions/contexts#jobs-context)." }, steps: { description: "Information about the steps that have been run in the current job. For more information, see [`steps` context](https://docs.github.com/actions/learn-github-actions/contexts#steps-context)." }, runner: { description: "Information about the runner that is running the current job. For more information, see [`runner` context](https://docs.github.com/actions/learn-github-actions/contexts#runner-context)." }, secrets: { description: "Contains the names and values of secrets that are available to a workflow run. For more information, see [`secrets` context](https://docs.github.com/actions/learn-github-actions/contexts#secrets-context)." }, strategy: { description: "Information about the matrix execution strategy for the current job. For more information, see [`strategy` context](https://docs.github.com/actions/learn-github-actions/contexts#strategy-context)." }, matrix: { description: "Contains the matrix properties defined in the workflow that apply to the current job. For more information, see [`matrix` context](https://docs.github.com/actions/learn-github-actions/contexts#matrix-context)." }, needs: { description: "Contains the outputs of all jobs that are defined as a dependency of the current job. For more information, see [`needs` context](https://docs.github.com/actions/learn-github-actions/contexts#needs-context)." }, inputs: { description: "Contains the inputs of a reusable or manually triggered workflow. For more information, see [`inputs` context](https://docs.github.com/actions/learn-github-actions/contexts#inputs-context)." } }, functions: { always: { description: "Causes the step to always execute, and returns `true`, even when canceled. The `always` expression is best used at the step level or on tasks that you expect to run even when a job is canceled. For example, you can use `always` to send logs even when a job is canceled." }, cancelled: { description: "Returns `true` if the workflow was canceled." }, failure: { description: "Returns `true` when any previous step of a job fails. If you have a chain of dependent jobs, `failure()` returns `true` if any ancestor job fails." }, hashFiles: { description: 'Returns a single hash for the set of files that matches the `path` pattern. You can provide a single `path` pattern or multiple `path` patterns separated by commas. The `path` is relative to the `GITHUB_WORKSPACE` directory and can only include files inside of the `GITHUB_WORKSPACE`. This function calculates an individual SHA-256 hash for each matched file, and then uses those hashes to calculate a final SHA-256 hash for the set of files. If the `path` pattern does not match any files, this returns an empty string. For more information about SHA-256, see "[SHA-2](https://wikipedia.org/wiki/SHA-2)."\n\nYou can use pattern matching characters to match file names. Pattern matching is case-insensitive on Windows. For more information about supported pattern matching characters, see "[Workflow syntax for GitHub Actions](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet)."' } }, github: { action: { description: "The name of the action currently running, or the [`id`](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsid) of a step. GitHub removes special characters, and uses the name `__run` when the current step runs a script without an `id`. If you use the same action more than once in the same job, the name will include a suffix with the sequence number with underscore before it. For example, the first script you run will have the name `__run`, and the second script will be named `__run_2`. Similarly, the second invocation of `actions/checkout` will be `actionscheckout2`." }, action_path: { description: "The path where an action is located. This property is only supported in composite actions. You can use this path to access files located in the same repository as the action, for example by changing directories to the path: `cd ${{ github.action_path }}`." }, action_ref: { description: "For a step executing an action, this is the ref of the action being executed. For example, `v2`." }, action_repository: { description: "For a step executing an action, this is the owner and repository name of the action. For example, `actions/checkout`." }, action_status: { description: "For a composite action, the current result of the composite action." }, actor: { description: "The username of the user that triggered the initial workflow run. If the workflow run is a re-run, this value may differ from `github.triggering_actor`. Any workflow re-runs will use the privileges of `github.actor`, even if the actor initiating the re-run (`github.triggering_actor`) has different privileges." }, actor_id: { description: "The account ID of the person or app that triggered the initial workflow run. For example, `1234567`. Note that this is different from the actor username.", versions: { ghes: ">=3.9", ghae: ">=3.9" } }, api_url: { description: "The URL of the GitHub REST API." }, base_ref: { description: "The `base_ref` or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either `pull_request` or `pull_request_target`." }, env: { description: 'Path on the runner to the file that sets environment variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see "[Workflow commands for GitHub Actions](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable)."' }, event: { description: 'The full event webhook payload. You can access individual properties of the event using this context. This object is identical to the webhook payload of the event that triggered the workflow run, and is different for each event. The webhooks for each GitHub Actions event is linked in "[Events that trigger workflows](https://docs.github.com/actions/using-workflows/events-that-trigger-workflows)." For example, for a workflow run triggered by the [`push` event](https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#push), this object contains the contents of the [push webhook payload](https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#push).' }, event_name: { description: "The name of the event that triggered the workflow run." }, event_path: { description: "The path to the file on the runner that contains the full event webhook payload." }, graphql_url: { description: "The URL of the GitHub GraphQL API." }, head_ref: { description: "The `head_ref` or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either `pull_request` or `pull_request_target`." }, job: { description: "The [`job_id`](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_id) of the current job.\nNote: This context property is set by the Actions runner, and is only available within the execution `steps` of a job. Otherwise, the value of this property will be `null`." }, job_workflow_sha: { description: "For jobs using a reusable workflow, the commit SHA for the reusable workflow file.", versions: { ghes: ">=3.9", ghae: ">=3.9" } }, path: { description: 'Path on the runner to the file that sets system PATH variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see "[Workflow commands for GitHub Actions](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path)."' }, ref: { description: "The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by `push`, this is the branch or tag ref that was pushed. For workflows triggered by `pull_request`, this is the pull request merge branch. For workflows triggered by `release`, this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format is `refs/heads/<branch_name>`, for pull requests it is `refs/pull/<pr_number>/merge`, and for tags it is `refs/tags/<tag_name>`. For example, `refs/heads/feature-branch-1`." }, ref_name: { description: "The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, `feature-branch-1`." }, ref_protected: { description: "`true` if branch protections are configured for the ref that triggered the workflow run." }, ref_type: { description: "The type of ref that triggered the workflow run. Valid values are `branch` or `tag`." }, repository: { description: "The owner and repository name. For example, `octocat/Hello-World`." }, repository_id: { description: "The ID of the repository. For example, `123456789`. Note that this is different from the repository name.", versions: { ghes: ">=3.9", ghae: ">=3.9" } }, repository_owner: { description: "The repository owner's username. For example, `octocat`." }, repository_owner_id: { description: "The repository owner's account ID. For example, `1234567`. Note that this is different from the owner's name.", versions: { ghes: ">=3.9", ghae: ">=3.9" } }, repositoryUrl: { description: "The Git URL to the repository. For example, `git://github.com/octocat/hello-world.git`." }, retention_days: { description: "The number of days that workflow run logs and artifacts are kept." }, run_id: { description: "A unique number for each workflow run within a repository. This number does not change if you re-run the workflow run." }, run_number: { description: "A unique number for each run of a particular workflow in a repository. This number begins at 1 for the workflow's first run, and increments with each new run. This number does not change if you re-run the workflow run." }, run_attempt: { description: "A unique number for each attempt of a particular workflow run in a repository. This number begins at 1 for the workflow run's first attempt, and increments with each re-run." }, secret_source: { description: "The source of a secret used in a workflow. Possible values are `None`, `Actions`, `Dependabot`, or `Codespaces`." }, server_url: { description: "The URL of the GitHub server. For example: `https://github.com`." }, sha: { description: 'The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see "[Events that trigger workflows](https://docs.github.com/actions/using-workflows/events-that-trigger-workflows)." For example, `ffac537e6cbbf934b08745a378932722df287a53`.' }, token: { description: 'A token to authenticate on behalf of the GitHub App installed on your repository. This is functionally equivalent to the `GITHUB_TOKEN` secret. For more information, see "[Automatic token authentication](https://docs.github.com/actions/security-guides/automatic-token-authentication)."\nNote: This context property is set by the Actions runner, and is only available within the execution `steps` of a job. Otherwise, the value of this property will be `null`.' }, triggering_actor: { description: "The username of the user that initiated the workflow run. If the workflow run is a re-run, this value may differ from `github.actor`. Any workflow re-runs will use the privileges of `github.actor`, even if the actor initiating the re-run (`github.triggering_actor`) has different privileges." }, workflow: { description: "The name of the workflow. If the workflow file doesn't specify a `name`, the value of this property is the full path of the workflow file in the repository." }, workflow_ref: { description: "The ref path to the workflow. For example, `octocat/hello-world/.github/workflows/my-workflow.yml@refs/heads/my_branch`.", versions: { ghes: ">=3.9", ghae: ">=3.9" } }, workflow_sha: { description: "The commit SHA for the workflow file.", versions: { ghes: ">=3.9", ghae: ">=3.9" } }, workspace: { description: "The default working directory on the runner for steps, and the default location of your repository when using the [`checkout`](https://github.com/actions/checkout) action." } }, job: { container: { description: `Information about the job's container. For more information about containers, see "[Running jobs in a container](https://docs.github.com/actions/using-jobs/running-jobs-in-a-container)."` }, "container.id": { description: "The ID of the container." }, "container.network": { description: "The ID of the container network. The runner creates the network used by all containers in a job." }, services: { description: 'The service containers created for a job. For more information about service containers, see "[Using service containers](https://docs.github.com/actions/using-containerized-services/about-service-containers)."' }, "services.<service_id>.id": { description: "The ID of the service container." }, "services.<service_id>.network": { description: "The ID of the service container network. The runner creates the network used by all containers in a job." }, "services.<service_id>.ports": { description: "The exposed ports of the service container." }, status: { description: "The current status of the job. Possible values are `success`, `failure`, or `cancelled`." }, check_run_id: { description: "The unique identifier of the check run for this job." } }, secrets: { GITHUB_TOKEN: { description: 'Automatically created token for each workflow run. For more information, see "[Automatic token authentication](https://docs.github.com/actions/security-guides/automatic-token-authentication)."' } }, jobs: { outputs: { description: "The set of outputs of a job in a reusable workflow." }, result: { description: "The result of a job in the reusable workflow. Possible values are `success`, `failure`, `cancelled`, or `skipped`." } }, steps: { outputs: { description: 'The set of outputs defined for the step. For more information, see "[Metadata syntax for GitHub Actions](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#outputs-for-docker-container-and-javascript-actions)."' }, conclusion: { description: "The result of a completed step after [`continue-on-error`](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error) is applied. Possible values are `success`, `failure`, `cancelled`, or `skipped`. When a `continue-on-error` step fails, the `outcome` is `failure`, but the final conclusion is `success`." }, outcome: { description: "The result of a completed step before [`continue-on-error`](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error) is applied. Possible values are `success`, `failure`, `cancelled`, or `skipped`. When a `continue-on-error` step fails, the `outcome` is `failure`, but the final conclusion is `success`." } }, runner: { name: { description: "The name of the runner executing the job." }, os: { description: "The operating system of the runner executing the job. Possible values are `Linux`, `Windows`, or `macOS`." }, arch: { description: "The architecture of the runner executing the job. Possible values are `X86`, `X64`, `ARM`, or `ARM64`." }, temp: { description: "The path to a temporary directory on the runner. This directory is emptied at the beginning and end of each job. Note that files will not be removed if the runner's user account does not have permission to delete them." }, tool_cache: { description: 'The path to the directory containing preinstalled tools for GitHub-hosted runners. For more information, see "[About GitHub-hosted runners](https://docs.github.com/actions/reference/specifications-for-github-hosted-runners/#supported-software)."' }, debug: { description: 'This is set only if [`ACTIONS_STEP_DEBUG`](https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging) is enabled, and always has the value of `"1"`. It can be useful as an indicator to enable additional debugging or verbose logging in your own job steps.' }, environment: { description: "The environment of the runner executing the job. Possible values are `github-hosted` for GitHub-hosted runners, or `self-hosted` for self-hosted runners." }, workspace: { description: "The runner-specific working directory path for the job." } }, strategy: { "fail-fast": { description: 'When `true`, all in-progress jobs are canceled if any job in a matrix fails. For more information, see "[Workflow syntax for GitHub Actions](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast)."' }, "job-index": { description: "The index of the current job in the matrix. **Note:** This number is a zero-based number. The first job's index in the matrix is `0`." }, "job-total": { description: "The total number of jobs in the matrix. **Note:** This number **is not** a zero-based number. For example, for a matrix with four jobs, the value of `job-total` is `4`." }, "max-parallel": { description: 'The maximum number of jobs that can run simultaneously when using a matrix job strategy. For more information, see "[Workflow syntax for GitHub Actions](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymax-parallel)."' } } };
|
|
23074
23148
|
|
|
23075
23149
|
// ../languageservice/dist/context-providers/descriptions.js
|
|
23076
23150
|
var RootContext = "root";
|
|
@@ -23397,7 +23471,7 @@ function getJobContext(workflowContext) {
|
|
|
23397
23471
|
const jobContainer = job.container;
|
|
23398
23472
|
if (jobContainer && isMapping(jobContainer)) {
|
|
23399
23473
|
const containerContext = createContainerContext(jobContainer, false);
|
|
23400
|
-
jobContext.add("container", containerContext);
|
|
23474
|
+
jobContext.add("container", containerContext, getDescription("job", "container"));
|
|
23401
23475
|
}
|
|
23402
23476
|
const jobServices = job.services;
|
|
23403
23477
|
if (jobServices && isMapping(jobServices)) {
|
|
@@ -23409,33 +23483,29 @@ function getJobContext(workflowContext) {
|
|
|
23409
23483
|
const serviceContext = createContainerContext(service.value, true);
|
|
23410
23484
|
servicesContext.add(service.key.toString(), serviceContext);
|
|
23411
23485
|
}
|
|
23412
|
-
jobContext.add("services", servicesContext);
|
|
23486
|
+
jobContext.add("services", servicesContext, getDescription("job", "services"));
|
|
23413
23487
|
}
|
|
23414
|
-
jobContext.add("status", new data_exports.
|
|
23415
|
-
jobContext.add("check_run_id", new data_exports.
|
|
23488
|
+
jobContext.add("status", new data_exports.StringData(""), getDescription("job", "status"));
|
|
23489
|
+
jobContext.add("check_run_id", new data_exports.StringData(""), getDescription("job", "check_run_id"));
|
|
23416
23490
|
return jobContext;
|
|
23417
23491
|
}
|
|
23418
23492
|
function createContainerContext(container, isServices) {
|
|
23419
|
-
const containerContext = new
|
|
23420
|
-
|
|
23421
|
-
|
|
23422
|
-
|
|
23423
|
-
|
|
23424
|
-
|
|
23425
|
-
|
|
23426
|
-
|
|
23427
|
-
|
|
23428
|
-
|
|
23429
|
-
ports.add(
|
|
23430
|
-
} else {
|
|
23431
|
-
ports.add(portParts[0], new data_exports.Null());
|
|
23493
|
+
const containerContext = new DescriptionDictionary();
|
|
23494
|
+
containerContext.add("id", new data_exports.StringData(""), getDescription("job", isServices ? "services.<service_id>.id" : "container.id"));
|
|
23495
|
+
containerContext.add("network", new data_exports.StringData(""), getDescription("job", isServices ? "services.<service_id>.network" : "container.network"));
|
|
23496
|
+
if (isServices) {
|
|
23497
|
+
const ports = new DescriptionDictionary();
|
|
23498
|
+
for (const { key, value } of container) {
|
|
23499
|
+
if (key.toString() === "ports" && isSequence(value)) {
|
|
23500
|
+
for (const item of value) {
|
|
23501
|
+
const portParts = item.toString().split(":");
|
|
23502
|
+
const containerPort = portParts.length === 2 ? portParts[1] : portParts[0];
|
|
23503
|
+
ports.add(containerPort, new data_exports.StringData(""));
|
|
23432
23504
|
}
|
|
23433
23505
|
}
|
|
23434
|
-
containerContext.add(key.toString(), ports);
|
|
23435
23506
|
}
|
|
23507
|
+
containerContext.add("ports", ports, getDescription("job", "services.<service_id>.ports"));
|
|
23436
23508
|
}
|
|
23437
|
-
containerContext.add("id", new data_exports.Null());
|
|
23438
|
-
containerContext.add("network", new data_exports.Null());
|
|
23439
23509
|
return containerContext;
|
|
23440
23510
|
}
|
|
23441
23511
|
|
|
@@ -23666,57 +23736,6 @@ function isGenerated(step) {
|
|
|
23666
23736
|
return step.id.startsWith("__");
|
|
23667
23737
|
}
|
|
23668
23738
|
|
|
23669
|
-
// ../languageservice/dist/utils/scalar-to-data.js
|
|
23670
|
-
function scalarToData(scalar) {
|
|
23671
|
-
if (isNumber(scalar)) {
|
|
23672
|
-
return new data_exports.NumberData(scalar.value);
|
|
23673
|
-
}
|
|
23674
|
-
if (isString(scalar)) {
|
|
23675
|
-
return new data_exports.StringData(scalar.value);
|
|
23676
|
-
}
|
|
23677
|
-
if (isBoolean(scalar)) {
|
|
23678
|
-
return new data_exports.BooleanData(scalar.value);
|
|
23679
|
-
}
|
|
23680
|
-
if (scalar.templateTokenType === TokenType2.Null) {
|
|
23681
|
-
return new data_exports.Null();
|
|
23682
|
-
}
|
|
23683
|
-
return new data_exports.StringData(scalar.toDisplayString());
|
|
23684
|
-
}
|
|
23685
|
-
|
|
23686
|
-
// ../languageservice/dist/context-providers/strategy.js
|
|
23687
|
-
var DEFAULT_STRATEGY = {
|
|
23688
|
-
"fail-fast": new data_exports.BooleanData(true),
|
|
23689
|
-
"job-index": new data_exports.NumberData(0),
|
|
23690
|
-
"job-total": new data_exports.NumberData(1),
|
|
23691
|
-
"max-parallel": new data_exports.NumberData(1)
|
|
23692
|
-
};
|
|
23693
|
-
function getStrategyContext(workflowContext) {
|
|
23694
|
-
const keys = ["fail-fast", "job-index", "job-total", "max-parallel"];
|
|
23695
|
-
const strategy = workflowContext.job?.strategy ?? workflowContext.reusableWorkflowJob?.strategy;
|
|
23696
|
-
if (!strategy || !isMapping(strategy)) {
|
|
23697
|
-
return new DescriptionDictionary(...keys.map((key) => {
|
|
23698
|
-
return { key, value: DEFAULT_STRATEGY[key] };
|
|
23699
|
-
}));
|
|
23700
|
-
}
|
|
23701
|
-
const strategyContext = new DescriptionDictionary();
|
|
23702
|
-
for (const pair of strategy) {
|
|
23703
|
-
if (!isString(pair.key)) {
|
|
23704
|
-
continue;
|
|
23705
|
-
}
|
|
23706
|
-
if (!keys.includes(pair.key.value)) {
|
|
23707
|
-
continue;
|
|
23708
|
-
}
|
|
23709
|
-
const value = isScalar(pair.value) ? scalarToData(pair.value) : new data_exports.Null();
|
|
23710
|
-
strategyContext.add(pair.key.value, value);
|
|
23711
|
-
}
|
|
23712
|
-
for (const key of keys) {
|
|
23713
|
-
if (!strategyContext.get(key)) {
|
|
23714
|
-
strategyContext.add(key, DEFAULT_STRATEGY[key]);
|
|
23715
|
-
}
|
|
23716
|
-
}
|
|
23717
|
-
return strategyContext;
|
|
23718
|
-
}
|
|
23719
|
-
|
|
23720
23739
|
// ../languageservice/dist/context-providers/default.js
|
|
23721
23740
|
var Mode;
|
|
23722
23741
|
(function(Mode2) {
|
|
@@ -23724,7 +23743,7 @@ var Mode;
|
|
|
23724
23743
|
Mode2[Mode2["Validation"] = 1] = "Validation";
|
|
23725
23744
|
Mode2[Mode2["Hover"] = 2] = "Hover";
|
|
23726
23745
|
})(Mode = Mode || (Mode = {}));
|
|
23727
|
-
async function
|
|
23746
|
+
async function getWorkflowExpressionContext(names, config, workflowContext, mode) {
|
|
23728
23747
|
const context = new DescriptionDictionary();
|
|
23729
23748
|
for (const contextName of names) {
|
|
23730
23749
|
let value = getDefaultContext(contextName, workflowContext, mode) || new DescriptionDictionary();
|
|
@@ -23732,7 +23751,7 @@ async function getContext(names, config, workflowContext, mode) {
|
|
|
23732
23751
|
context.add(contextName, value);
|
|
23733
23752
|
continue;
|
|
23734
23753
|
}
|
|
23735
|
-
const remoteValue = await config?.getContext(contextName, value, workflowContext, mode);
|
|
23754
|
+
const remoteValue = workflowContext ? await config?.getContext(contextName, value, workflowContext, mode) : void 0;
|
|
23736
23755
|
if (remoteValue) {
|
|
23737
23756
|
value = remoteValue;
|
|
23738
23757
|
} else if (contextName === "secrets" || contextName === "vars") {
|
|
@@ -23745,46 +23764,108 @@ async function getContext(names, config, workflowContext, mode) {
|
|
|
23745
23764
|
function getDefaultContext(name, workflowContext, mode) {
|
|
23746
23765
|
switch (name) {
|
|
23747
23766
|
case "env":
|
|
23748
|
-
return getEnvContext(workflowContext);
|
|
23767
|
+
return workflowContext ? getEnvContext(workflowContext) : new DescriptionDictionary();
|
|
23749
23768
|
case "github":
|
|
23750
23769
|
return getGithubContext(workflowContext, mode);
|
|
23751
23770
|
case "inputs":
|
|
23752
|
-
return getInputsContext(workflowContext);
|
|
23771
|
+
return workflowContext ? getInputsContext(workflowContext) : new DescriptionDictionary();
|
|
23753
23772
|
case "reusableWorkflowJob":
|
|
23754
23773
|
case "job":
|
|
23755
|
-
return getJobContext(workflowContext);
|
|
23774
|
+
return workflowContext ? getJobContext(workflowContext) : new DescriptionDictionary();
|
|
23756
23775
|
case "jobs":
|
|
23757
|
-
return getJobsContext(workflowContext);
|
|
23776
|
+
return workflowContext ? getJobsContext(workflowContext) : new DescriptionDictionary();
|
|
23758
23777
|
case "matrix":
|
|
23759
|
-
return getMatrixContext(workflowContext, mode);
|
|
23778
|
+
return workflowContext ? getMatrixContext(workflowContext, mode) : new DescriptionDictionary();
|
|
23760
23779
|
case "needs":
|
|
23761
|
-
return getNeedsContext(workflowContext);
|
|
23780
|
+
return workflowContext ? getNeedsContext(workflowContext) : new DescriptionDictionary();
|
|
23762
23781
|
case "runner":
|
|
23763
|
-
return
|
|
23764
|
-
arch: "X64",
|
|
23765
|
-
debug: "1",
|
|
23766
|
-
environment: "github-hosted",
|
|
23767
|
-
name: "GitHub Actions 2",
|
|
23768
|
-
os: "Linux",
|
|
23769
|
-
temp: "/home/runner/work/_temp",
|
|
23770
|
-
tool_cache: "/opt/hostedtoolcache",
|
|
23771
|
-
workspace: "/home/runner/work/repo"
|
|
23772
|
-
});
|
|
23782
|
+
return getRunnerContext();
|
|
23773
23783
|
case "secrets":
|
|
23774
|
-
return getSecretsContext(workflowContext, mode);
|
|
23784
|
+
return workflowContext ? getSecretsContext(workflowContext, mode) : new DescriptionDictionary();
|
|
23785
|
+
case "steps":
|
|
23786
|
+
return workflowContext ? getStepsContext(workflowContext) : new DescriptionDictionary();
|
|
23787
|
+
case "strategy":
|
|
23788
|
+
return getStrategyContext();
|
|
23789
|
+
}
|
|
23790
|
+
return void 0;
|
|
23791
|
+
}
|
|
23792
|
+
function getStrategyContext() {
|
|
23793
|
+
return new DescriptionDictionary({ key: "fail-fast", value: new data_exports.BooleanData(true), description: getDescription("strategy", "fail-fast") }, { key: "job-index", value: new data_exports.NumberData(0), description: getDescription("strategy", "job-index") }, { key: "job-total", value: new data_exports.NumberData(1), description: getDescription("strategy", "job-total") }, { key: "max-parallel", value: new data_exports.NumberData(1), description: getDescription("strategy", "max-parallel") });
|
|
23794
|
+
}
|
|
23795
|
+
function getRunnerContext() {
|
|
23796
|
+
return new DescriptionDictionary({ key: "arch", value: new data_exports.StringData("X64"), description: getDescription("runner", "arch") }, { key: "debug", value: new data_exports.StringData("1"), description: getDescription("runner", "debug") }, {
|
|
23797
|
+
key: "environment",
|
|
23798
|
+
value: new data_exports.StringData("github-hosted"),
|
|
23799
|
+
description: getDescription("runner", "environment")
|
|
23800
|
+
}, { key: "name", value: new data_exports.StringData("GitHub Actions 2"), description: getDescription("runner", "name") }, { key: "os", value: new data_exports.StringData("Linux"), description: getDescription("runner", "os") }, { key: "temp", value: new data_exports.StringData("/home/runner/work/_temp"), description: getDescription("runner", "temp") }, {
|
|
23801
|
+
key: "tool_cache",
|
|
23802
|
+
value: new data_exports.StringData("/opt/hostedtoolcache"),
|
|
23803
|
+
description: getDescription("runner", "tool_cache")
|
|
23804
|
+
}, {
|
|
23805
|
+
key: "workspace",
|
|
23806
|
+
value: new data_exports.StringData("/home/runner/work/repo"),
|
|
23807
|
+
description: getDescription("runner", "workspace")
|
|
23808
|
+
});
|
|
23809
|
+
}
|
|
23810
|
+
function getActionExpressionContext(names, config, actionContext, mode) {
|
|
23811
|
+
const context = new DescriptionDictionary();
|
|
23812
|
+
for (const contextName of names) {
|
|
23813
|
+
const value = getDefaultActionContext(contextName, actionContext, mode);
|
|
23814
|
+
if (value) {
|
|
23815
|
+
context.add(contextName, value, getDescription(RootContext, contextName));
|
|
23816
|
+
}
|
|
23817
|
+
}
|
|
23818
|
+
return context;
|
|
23819
|
+
}
|
|
23820
|
+
function getDefaultActionContext(name, actionContext, mode) {
|
|
23821
|
+
switch (name) {
|
|
23822
|
+
case "inputs":
|
|
23823
|
+
return actionContext ? getActionInputsContext(actionContext) : new DescriptionDictionary();
|
|
23775
23824
|
case "steps":
|
|
23776
|
-
return
|
|
23825
|
+
return actionContext ? getActionStepsContext(actionContext) : new DescriptionDictionary();
|
|
23826
|
+
case "github":
|
|
23827
|
+
return getGithubContext(void 0, mode);
|
|
23828
|
+
case "runner":
|
|
23829
|
+
return getRunnerContext();
|
|
23830
|
+
case "env":
|
|
23831
|
+
return new DescriptionDictionary();
|
|
23832
|
+
case "job": {
|
|
23833
|
+
const jobContext = new DescriptionDictionary();
|
|
23834
|
+
jobContext.add("status", new data_exports.StringData(""), getDescription("job", "status"));
|
|
23835
|
+
jobContext.add("check_run_id", new data_exports.StringData(""), getDescription("job", "check_run_id"));
|
|
23836
|
+
const containerContext = new DescriptionDictionary();
|
|
23837
|
+
containerContext.add("id", new data_exports.StringData(""), getDescription("job", "container.id"));
|
|
23838
|
+
containerContext.add("network", new data_exports.StringData(""), getDescription("job", "container.network"));
|
|
23839
|
+
jobContext.add("container", containerContext, getDescription("job", "container"));
|
|
23840
|
+
jobContext.add("services", new DescriptionDictionary(), getDescription("job", "services"));
|
|
23841
|
+
return jobContext;
|
|
23842
|
+
}
|
|
23777
23843
|
case "strategy":
|
|
23778
|
-
return getStrategyContext(
|
|
23844
|
+
return getStrategyContext();
|
|
23845
|
+
case "matrix":
|
|
23846
|
+
return new DescriptionDictionary();
|
|
23779
23847
|
}
|
|
23780
23848
|
return void 0;
|
|
23781
23849
|
}
|
|
23782
|
-
function
|
|
23783
|
-
const
|
|
23784
|
-
|
|
23785
|
-
|
|
23850
|
+
function getActionInputsContext(actionContext) {
|
|
23851
|
+
const dict = new DescriptionDictionary();
|
|
23852
|
+
const inputs2 = getActionInputs(actionContext.template);
|
|
23853
|
+
for (const input of inputs2) {
|
|
23854
|
+
dict.add(input.id, new data_exports.StringData(""), input.description || "");
|
|
23855
|
+
}
|
|
23856
|
+
return dict;
|
|
23857
|
+
}
|
|
23858
|
+
function getActionStepsContext(actionContext) {
|
|
23859
|
+
const dict = new DescriptionDictionary();
|
|
23860
|
+
const stepIds = getActionStepIdsBefore(actionContext);
|
|
23861
|
+
for (const stepId of stepIds) {
|
|
23862
|
+
const stepDict = new DescriptionDictionary();
|
|
23863
|
+
stepDict.add("outputs", new DescriptionDictionary(), getDescription("steps", "outputs"));
|
|
23864
|
+
stepDict.add("outcome", new data_exports.StringData("success"), getDescription("steps", "outcome"));
|
|
23865
|
+
stepDict.add("conclusion", new data_exports.StringData("success"), getDescription("steps", "conclusion"));
|
|
23866
|
+
dict.add(stepId, stepDict, `Step: ${stepId}`);
|
|
23786
23867
|
}
|
|
23787
|
-
return
|
|
23868
|
+
return dict;
|
|
23788
23869
|
}
|
|
23789
23870
|
|
|
23790
23871
|
// ../languageservice/dist/context/workflow-context.js
|
|
@@ -23826,11 +23907,11 @@ function getWorkflowContext(uri, template, tokenPath) {
|
|
|
23826
23907
|
}
|
|
23827
23908
|
}
|
|
23828
23909
|
if (context.job && isJob(context.job)) {
|
|
23829
|
-
context.step =
|
|
23910
|
+
context.step = findStep2(context.job.steps, stepsSequence, stepToken);
|
|
23830
23911
|
}
|
|
23831
23912
|
return context;
|
|
23832
23913
|
}
|
|
23833
|
-
function
|
|
23914
|
+
function findStep2(steps, stepSequence, stepToken) {
|
|
23834
23915
|
if (!steps || !stepSequence || !stepToken) {
|
|
23835
23916
|
return void 0;
|
|
23836
23917
|
}
|
|
@@ -23904,6 +23985,21 @@ function error(message) {
|
|
|
23904
23985
|
}
|
|
23905
23986
|
}
|
|
23906
23987
|
|
|
23988
|
+
// ../languageservice/dist/utils/document-type.js
|
|
23989
|
+
function detectDocumentType(uri) {
|
|
23990
|
+
const normalizedUri = uri.replace(/\\/g, "/");
|
|
23991
|
+
if (/\.github\/workflows(-lab)?\/[^/]+\.ya?ml$/i.test(normalizedUri)) {
|
|
23992
|
+
return "workflow";
|
|
23993
|
+
}
|
|
23994
|
+
if (/\/action\.ya?ml$/i.test(normalizedUri) || /^action\.ya?ml$/i.test(normalizedUri)) {
|
|
23995
|
+
return "action";
|
|
23996
|
+
}
|
|
23997
|
+
return "unknown";
|
|
23998
|
+
}
|
|
23999
|
+
function isActionDocument(uri) {
|
|
24000
|
+
return detectDocumentType(uri) === "action";
|
|
24001
|
+
}
|
|
24002
|
+
|
|
23907
24003
|
// ../languageservice/dist/utils/expression-detection.js
|
|
23908
24004
|
function isPotentiallyExpression(token) {
|
|
23909
24005
|
const containsExpression = isString(token) && token.value != null && token.value.indexOf(OPEN_EXPRESSION) >= 0;
|
|
@@ -24282,24 +24378,402 @@ function isPlaceholder(key, value) {
|
|
|
24282
24378
|
return false;
|
|
24283
24379
|
}
|
|
24284
24380
|
|
|
24381
|
+
// ../workflow-parser/dist/actions/action-constants.js
|
|
24382
|
+
var ACTION_ROOT = "action-root-strict";
|
|
24383
|
+
|
|
24384
|
+
// ../workflow-parser/dist/actions/action-parser.js
|
|
24385
|
+
function parseAction(entryFile, contextOrTrace) {
|
|
24386
|
+
const context = contextOrTrace instanceof TemplateContext ? contextOrTrace : new TemplateContext(new TemplateValidationErrors(), getActionSchema(), contextOrTrace);
|
|
24387
|
+
const fileId = context.getFileId(entryFile.name);
|
|
24388
|
+
const reader = new YamlObjectReader(fileId, entryFile.content);
|
|
24389
|
+
if (reader.errors.length > 0) {
|
|
24390
|
+
for (const err of reader.errors) {
|
|
24391
|
+
context.error(fileId, err.message, err.range);
|
|
24392
|
+
}
|
|
24393
|
+
return {
|
|
24394
|
+
context,
|
|
24395
|
+
value: void 0
|
|
24396
|
+
};
|
|
24397
|
+
}
|
|
24398
|
+
const result = readTemplate(context, ACTION_ROOT, reader, fileId);
|
|
24399
|
+
return {
|
|
24400
|
+
context,
|
|
24401
|
+
value: result
|
|
24402
|
+
};
|
|
24403
|
+
}
|
|
24404
|
+
|
|
24405
|
+
// ../workflow-parser/dist/actions/action-template.js
|
|
24406
|
+
function convertActionTemplate(context, root, options) {
|
|
24407
|
+
const result = {};
|
|
24408
|
+
const errorPolicy = options?.errorPolicy ?? ErrorPolicy.ReturnErrorsOnly;
|
|
24409
|
+
if (context.errors.getErrors().length > 0 && errorPolicy === ErrorPolicy.ReturnErrorsOnly) {
|
|
24410
|
+
return result;
|
|
24411
|
+
}
|
|
24412
|
+
if (!isMapping(root)) {
|
|
24413
|
+
context.error(root, new Error("Action must be a mapping"));
|
|
24414
|
+
return result;
|
|
24415
|
+
}
|
|
24416
|
+
for (const item of root) {
|
|
24417
|
+
const key = item.key.assertString("action key");
|
|
24418
|
+
switch (key.value) {
|
|
24419
|
+
case "name":
|
|
24420
|
+
if (isString(item.value)) {
|
|
24421
|
+
result.name = item.value.value;
|
|
24422
|
+
}
|
|
24423
|
+
break;
|
|
24424
|
+
case "description":
|
|
24425
|
+
if (isString(item.value)) {
|
|
24426
|
+
result.description = item.value.value;
|
|
24427
|
+
}
|
|
24428
|
+
break;
|
|
24429
|
+
case "author":
|
|
24430
|
+
if (isString(item.value)) {
|
|
24431
|
+
result.author = item.value.value;
|
|
24432
|
+
}
|
|
24433
|
+
break;
|
|
24434
|
+
case "inputs":
|
|
24435
|
+
result.inputs = convertInputs(context, item.value);
|
|
24436
|
+
break;
|
|
24437
|
+
case "outputs":
|
|
24438
|
+
result.outputs = convertOutputs(context, item.value);
|
|
24439
|
+
break;
|
|
24440
|
+
case "runs":
|
|
24441
|
+
result.runs = convertRuns(context, item.value);
|
|
24442
|
+
break;
|
|
24443
|
+
case "branding":
|
|
24444
|
+
result.branding = convertBranding(context, item.value);
|
|
24445
|
+
break;
|
|
24446
|
+
}
|
|
24447
|
+
}
|
|
24448
|
+
return result;
|
|
24449
|
+
}
|
|
24450
|
+
function convertInputs(context, token) {
|
|
24451
|
+
const inputs2 = [];
|
|
24452
|
+
if (!isMapping(token)) {
|
|
24453
|
+
return inputs2;
|
|
24454
|
+
}
|
|
24455
|
+
for (const item of token) {
|
|
24456
|
+
const id = item.key.assertString("input id").value;
|
|
24457
|
+
const input = { id };
|
|
24458
|
+
if (isMapping(item.value)) {
|
|
24459
|
+
for (const prop of item.value) {
|
|
24460
|
+
const propKey = prop.key.assertString("input property").value;
|
|
24461
|
+
switch (propKey) {
|
|
24462
|
+
case "description":
|
|
24463
|
+
if (isString(prop.value)) {
|
|
24464
|
+
input.description = prop.value.value;
|
|
24465
|
+
}
|
|
24466
|
+
break;
|
|
24467
|
+
case "required":
|
|
24468
|
+
if (isBoolean(prop.value)) {
|
|
24469
|
+
input.required = prop.value.value;
|
|
24470
|
+
} else if (isString(prop.value)) {
|
|
24471
|
+
input.required = prop.value.value === "true";
|
|
24472
|
+
}
|
|
24473
|
+
break;
|
|
24474
|
+
case "default":
|
|
24475
|
+
if (isScalar(prop.value)) {
|
|
24476
|
+
input.default = prop.value;
|
|
24477
|
+
}
|
|
24478
|
+
break;
|
|
24479
|
+
case "deprecationMessage":
|
|
24480
|
+
if (isString(prop.value)) {
|
|
24481
|
+
input.deprecationMessage = prop.value.value;
|
|
24482
|
+
}
|
|
24483
|
+
break;
|
|
24484
|
+
}
|
|
24485
|
+
}
|
|
24486
|
+
}
|
|
24487
|
+
inputs2.push(input);
|
|
24488
|
+
}
|
|
24489
|
+
return inputs2;
|
|
24490
|
+
}
|
|
24491
|
+
function convertOutputs(context, token) {
|
|
24492
|
+
const outputs = [];
|
|
24493
|
+
if (!isMapping(token)) {
|
|
24494
|
+
return outputs;
|
|
24495
|
+
}
|
|
24496
|
+
for (const item of token) {
|
|
24497
|
+
const id = item.key.assertString("output id").value;
|
|
24498
|
+
const output = { id };
|
|
24499
|
+
if (isMapping(item.value)) {
|
|
24500
|
+
for (const prop of item.value) {
|
|
24501
|
+
const propKey = prop.key.assertString("output property").value;
|
|
24502
|
+
switch (propKey) {
|
|
24503
|
+
case "description":
|
|
24504
|
+
if (isString(prop.value)) {
|
|
24505
|
+
output.description = prop.value.value;
|
|
24506
|
+
}
|
|
24507
|
+
break;
|
|
24508
|
+
case "value":
|
|
24509
|
+
if (isScalar(prop.value)) {
|
|
24510
|
+
output.value = prop.value;
|
|
24511
|
+
}
|
|
24512
|
+
break;
|
|
24513
|
+
}
|
|
24514
|
+
}
|
|
24515
|
+
}
|
|
24516
|
+
outputs.push(output);
|
|
24517
|
+
}
|
|
24518
|
+
return outputs;
|
|
24519
|
+
}
|
|
24520
|
+
function convertRuns(context, token) {
|
|
24521
|
+
if (!isMapping(token)) {
|
|
24522
|
+
return { using: "composite", steps: [] };
|
|
24523
|
+
}
|
|
24524
|
+
let using;
|
|
24525
|
+
let main;
|
|
24526
|
+
let image;
|
|
24527
|
+
let pre;
|
|
24528
|
+
let preIf;
|
|
24529
|
+
let post;
|
|
24530
|
+
let postIf;
|
|
24531
|
+
let preEntrypoint;
|
|
24532
|
+
let entrypoint;
|
|
24533
|
+
let postEntrypoint;
|
|
24534
|
+
let args;
|
|
24535
|
+
let env;
|
|
24536
|
+
let steps = [];
|
|
24537
|
+
for (const item of token) {
|
|
24538
|
+
const key = item.key.assertString("runs property").value;
|
|
24539
|
+
switch (key) {
|
|
24540
|
+
case "using":
|
|
24541
|
+
if (isString(item.value)) {
|
|
24542
|
+
using = item.value.value;
|
|
24543
|
+
}
|
|
24544
|
+
break;
|
|
24545
|
+
case "main":
|
|
24546
|
+
if (isString(item.value)) {
|
|
24547
|
+
main = item.value.value;
|
|
24548
|
+
}
|
|
24549
|
+
break;
|
|
24550
|
+
case "image":
|
|
24551
|
+
if (isString(item.value)) {
|
|
24552
|
+
image = item.value.value;
|
|
24553
|
+
}
|
|
24554
|
+
break;
|
|
24555
|
+
case "pre":
|
|
24556
|
+
if (isString(item.value)) {
|
|
24557
|
+
pre = item.value.value;
|
|
24558
|
+
}
|
|
24559
|
+
break;
|
|
24560
|
+
case "pre-if":
|
|
24561
|
+
if (isString(item.value)) {
|
|
24562
|
+
preIf = item.value.value;
|
|
24563
|
+
}
|
|
24564
|
+
break;
|
|
24565
|
+
case "post":
|
|
24566
|
+
if (isString(item.value)) {
|
|
24567
|
+
post = item.value.value;
|
|
24568
|
+
}
|
|
24569
|
+
break;
|
|
24570
|
+
case "post-if":
|
|
24571
|
+
if (isString(item.value)) {
|
|
24572
|
+
postIf = item.value.value;
|
|
24573
|
+
}
|
|
24574
|
+
break;
|
|
24575
|
+
case "pre-entrypoint":
|
|
24576
|
+
if (isString(item.value)) {
|
|
24577
|
+
preEntrypoint = item.value.value;
|
|
24578
|
+
}
|
|
24579
|
+
break;
|
|
24580
|
+
case "entrypoint":
|
|
24581
|
+
if (isString(item.value)) {
|
|
24582
|
+
entrypoint = item.value.value;
|
|
24583
|
+
}
|
|
24584
|
+
break;
|
|
24585
|
+
case "post-entrypoint":
|
|
24586
|
+
if (isString(item.value)) {
|
|
24587
|
+
postEntrypoint = item.value.value;
|
|
24588
|
+
}
|
|
24589
|
+
break;
|
|
24590
|
+
case "args":
|
|
24591
|
+
if (isSequence(item.value)) {
|
|
24592
|
+
args = [];
|
|
24593
|
+
for (const arg of item.value) {
|
|
24594
|
+
if (isScalar(arg)) {
|
|
24595
|
+
args.push(arg.toString());
|
|
24596
|
+
}
|
|
24597
|
+
}
|
|
24598
|
+
}
|
|
24599
|
+
break;
|
|
24600
|
+
case "env":
|
|
24601
|
+
if (isMapping(item.value)) {
|
|
24602
|
+
env = {};
|
|
24603
|
+
for (const envItem of item.value) {
|
|
24604
|
+
const envKey = envItem.key.assertString("env key").value;
|
|
24605
|
+
if (isString(envItem.value)) {
|
|
24606
|
+
env[envKey] = envItem.value.value;
|
|
24607
|
+
}
|
|
24608
|
+
}
|
|
24609
|
+
}
|
|
24610
|
+
break;
|
|
24611
|
+
case "steps":
|
|
24612
|
+
steps = convertSteps2(context, item.value);
|
|
24613
|
+
break;
|
|
24614
|
+
}
|
|
24615
|
+
}
|
|
24616
|
+
if (using === "composite") {
|
|
24617
|
+
return { using: "composite", steps };
|
|
24618
|
+
} else if (using === "docker" && image) {
|
|
24619
|
+
return {
|
|
24620
|
+
using: "docker",
|
|
24621
|
+
image,
|
|
24622
|
+
preEntrypoint,
|
|
24623
|
+
preIf,
|
|
24624
|
+
entrypoint,
|
|
24625
|
+
postEntrypoint,
|
|
24626
|
+
postIf,
|
|
24627
|
+
args,
|
|
24628
|
+
env
|
|
24629
|
+
};
|
|
24630
|
+
} else if ((using === "node12" || using === "node16" || using === "node20" || using === "node24") && main) {
|
|
24631
|
+
return {
|
|
24632
|
+
using,
|
|
24633
|
+
main,
|
|
24634
|
+
pre,
|
|
24635
|
+
preIf,
|
|
24636
|
+
post,
|
|
24637
|
+
postIf
|
|
24638
|
+
};
|
|
24639
|
+
}
|
|
24640
|
+
return { using: "composite", steps: [] };
|
|
24641
|
+
}
|
|
24642
|
+
function convertSteps2(context, token) {
|
|
24643
|
+
const steps = [];
|
|
24644
|
+
if (!isSequence(token)) {
|
|
24645
|
+
return steps;
|
|
24646
|
+
}
|
|
24647
|
+
for (const stepToken of token) {
|
|
24648
|
+
if (!isMapping(stepToken)) {
|
|
24649
|
+
continue;
|
|
24650
|
+
}
|
|
24651
|
+
const step = convertStep2(context, stepToken);
|
|
24652
|
+
if (step) {
|
|
24653
|
+
steps.push(step);
|
|
24654
|
+
}
|
|
24655
|
+
}
|
|
24656
|
+
return steps;
|
|
24657
|
+
}
|
|
24658
|
+
function convertStep2(context, token) {
|
|
24659
|
+
let id;
|
|
24660
|
+
let name;
|
|
24661
|
+
let ifCondition;
|
|
24662
|
+
let continueOnError;
|
|
24663
|
+
let env;
|
|
24664
|
+
let run;
|
|
24665
|
+
let uses;
|
|
24666
|
+
for (const item of token) {
|
|
24667
|
+
const key = item.key.assertString("step property").value;
|
|
24668
|
+
switch (key) {
|
|
24669
|
+
case "id":
|
|
24670
|
+
if (isString(item.value)) {
|
|
24671
|
+
id = item.value.value;
|
|
24672
|
+
}
|
|
24673
|
+
break;
|
|
24674
|
+
case "name":
|
|
24675
|
+
if (isScalar(item.value)) {
|
|
24676
|
+
name = item.value;
|
|
24677
|
+
}
|
|
24678
|
+
break;
|
|
24679
|
+
case "if":
|
|
24680
|
+
ifCondition = convertToIfCondition(context, item.value);
|
|
24681
|
+
break;
|
|
24682
|
+
case "continue-on-error":
|
|
24683
|
+
if (isBoolean(item.value)) {
|
|
24684
|
+
continueOnError = item.value.value;
|
|
24685
|
+
} else if (isScalar(item.value)) {
|
|
24686
|
+
continueOnError = item.value;
|
|
24687
|
+
}
|
|
24688
|
+
break;
|
|
24689
|
+
case "env":
|
|
24690
|
+
if (isMapping(item.value)) {
|
|
24691
|
+
env = item.value;
|
|
24692
|
+
}
|
|
24693
|
+
break;
|
|
24694
|
+
case "run":
|
|
24695
|
+
if (isScalar(item.value)) {
|
|
24696
|
+
run = item.value;
|
|
24697
|
+
}
|
|
24698
|
+
break;
|
|
24699
|
+
case "uses":
|
|
24700
|
+
if (isString(item.value)) {
|
|
24701
|
+
uses = item.value;
|
|
24702
|
+
}
|
|
24703
|
+
break;
|
|
24704
|
+
}
|
|
24705
|
+
}
|
|
24706
|
+
const defaultIf = new BasicExpressionToken(void 0, void 0, "success()", void 0, void 0, void 0);
|
|
24707
|
+
if (run) {
|
|
24708
|
+
return {
|
|
24709
|
+
id: id || "",
|
|
24710
|
+
name,
|
|
24711
|
+
if: ifCondition || defaultIf,
|
|
24712
|
+
"continue-on-error": continueOnError,
|
|
24713
|
+
env,
|
|
24714
|
+
run
|
|
24715
|
+
};
|
|
24716
|
+
} else if (uses) {
|
|
24717
|
+
return {
|
|
24718
|
+
id: id || "",
|
|
24719
|
+
name,
|
|
24720
|
+
if: ifCondition || defaultIf,
|
|
24721
|
+
"continue-on-error": continueOnError,
|
|
24722
|
+
env,
|
|
24723
|
+
uses
|
|
24724
|
+
};
|
|
24725
|
+
}
|
|
24726
|
+
return void 0;
|
|
24727
|
+
}
|
|
24728
|
+
function convertBranding(context, token) {
|
|
24729
|
+
const branding = {};
|
|
24730
|
+
if (!isMapping(token)) {
|
|
24731
|
+
return branding;
|
|
24732
|
+
}
|
|
24733
|
+
for (const item of token) {
|
|
24734
|
+
const key = item.key.assertString("branding property").value;
|
|
24735
|
+
switch (key) {
|
|
24736
|
+
case "icon":
|
|
24737
|
+
if (isString(item.value)) {
|
|
24738
|
+
branding.icon = item.value.value;
|
|
24739
|
+
}
|
|
24740
|
+
break;
|
|
24741
|
+
case "color":
|
|
24742
|
+
if (isString(item.value)) {
|
|
24743
|
+
branding.color = item.value.value;
|
|
24744
|
+
}
|
|
24745
|
+
break;
|
|
24746
|
+
}
|
|
24747
|
+
}
|
|
24748
|
+
return branding;
|
|
24749
|
+
}
|
|
24750
|
+
|
|
24285
24751
|
// ../languageservice/dist/nulltrace.js
|
|
24286
24752
|
var nullTrace = new NoOperationTraceWriter();
|
|
24287
24753
|
|
|
24288
24754
|
// ../languageservice/dist/utils/workflow-cache.js
|
|
24289
24755
|
var parsedWorkflowCache = /* @__PURE__ */ new Map();
|
|
24756
|
+
var parsedActionCache = /* @__PURE__ */ new Map();
|
|
24290
24757
|
var workflowTemplateCache = /* @__PURE__ */ new Map();
|
|
24758
|
+
var actionTemplateCache = /* @__PURE__ */ new Map();
|
|
24291
24759
|
function clearCacheEntry(uri) {
|
|
24292
24760
|
parsedWorkflowCache.delete(uri);
|
|
24293
|
-
parsedWorkflowCache.delete(
|
|
24761
|
+
parsedWorkflowCache.delete(cacheKey(uri, true));
|
|
24762
|
+
parsedActionCache.delete(uri);
|
|
24763
|
+
parsedActionCache.delete(cacheKey(uri, true));
|
|
24294
24764
|
workflowTemplateCache.delete(uri);
|
|
24295
|
-
workflowTemplateCache.delete(
|
|
24765
|
+
workflowTemplateCache.delete(cacheKey(uri, true));
|
|
24766
|
+
actionTemplateCache.delete(uri);
|
|
24767
|
+
actionTemplateCache.delete(cacheKey(uri, true));
|
|
24296
24768
|
}
|
|
24297
24769
|
function clearCache() {
|
|
24298
24770
|
parsedWorkflowCache.clear();
|
|
24771
|
+
parsedActionCache.clear();
|
|
24299
24772
|
workflowTemplateCache.clear();
|
|
24773
|
+
actionTemplateCache.clear();
|
|
24300
24774
|
}
|
|
24301
|
-
function
|
|
24302
|
-
const key =
|
|
24775
|
+
function getOrParseWorkflow(file, uri, transformed = false) {
|
|
24776
|
+
const key = cacheKey(uri, transformed);
|
|
24303
24777
|
const cachedResult = parsedWorkflowCache.get(key);
|
|
24304
24778
|
if (cachedResult) {
|
|
24305
24779
|
return cachedResult;
|
|
@@ -24308,8 +24782,18 @@ function fetchOrParseWorkflow(file, uri, transformed = false) {
|
|
|
24308
24782
|
parsedWorkflowCache.set(key, result);
|
|
24309
24783
|
return result;
|
|
24310
24784
|
}
|
|
24311
|
-
|
|
24312
|
-
const key =
|
|
24785
|
+
function getOrParseAction(file, uri, transformed = false) {
|
|
24786
|
+
const key = cacheKey(uri, transformed);
|
|
24787
|
+
const cachedResult = parsedActionCache.get(key);
|
|
24788
|
+
if (cachedResult) {
|
|
24789
|
+
return cachedResult;
|
|
24790
|
+
}
|
|
24791
|
+
const result = parseAction(file, nullTrace);
|
|
24792
|
+
parsedActionCache.set(key, result);
|
|
24793
|
+
return result;
|
|
24794
|
+
}
|
|
24795
|
+
async function getOrConvertWorkflowTemplate(context, template, uri, config, options, transformed = false) {
|
|
24796
|
+
const key = cacheKey(uri, transformed);
|
|
24313
24797
|
const cachedTemplate = workflowTemplateCache.get(key);
|
|
24314
24798
|
if (cachedTemplate) {
|
|
24315
24799
|
return cachedTemplate;
|
|
@@ -24318,7 +24802,17 @@ async function fetchOrConvertWorkflowTemplate(context, template, uri, config, op
|
|
|
24318
24802
|
workflowTemplateCache.set(key, workflowTemplate);
|
|
24319
24803
|
return workflowTemplate;
|
|
24320
24804
|
}
|
|
24321
|
-
function
|
|
24805
|
+
function getOrConvertActionTemplate(context, template, uri, options, transformed = false) {
|
|
24806
|
+
const key = cacheKey(uri, transformed);
|
|
24807
|
+
const cachedTemplate = actionTemplateCache.get(key);
|
|
24808
|
+
if (cachedTemplate) {
|
|
24809
|
+
return cachedTemplate;
|
|
24810
|
+
}
|
|
24811
|
+
const actionTemplate = convertActionTemplate(context, template, options);
|
|
24812
|
+
actionTemplateCache.set(key, actionTemplate);
|
|
24813
|
+
return actionTemplate;
|
|
24814
|
+
}
|
|
24815
|
+
function cacheKey(uri, transformed) {
|
|
24322
24816
|
if (transformed) {
|
|
24323
24817
|
return `transformed-${uri}`;
|
|
24324
24818
|
}
|
|
@@ -24457,13 +24951,12 @@ var DefinitionValueMode;
|
|
|
24457
24951
|
DefinitionValueMode2[DefinitionValueMode2["Parent"] = 0] = "Parent";
|
|
24458
24952
|
DefinitionValueMode2[DefinitionValueMode2["Key"] = 1] = "Key";
|
|
24459
24953
|
})(DefinitionValueMode = DefinitionValueMode || (DefinitionValueMode = {}));
|
|
24460
|
-
function definitionValues(def, indentation, mode, tokenStructure) {
|
|
24461
|
-
const schema2 = getWorkflowSchema();
|
|
24954
|
+
function definitionValues(def, indentation, mode, tokenStructure, schema3) {
|
|
24462
24955
|
if (def instanceof MappingDefinition) {
|
|
24463
|
-
return mappingValues(def,
|
|
24956
|
+
return mappingValues(def, schema3.definitions, indentation, mode);
|
|
24464
24957
|
}
|
|
24465
24958
|
if (def instanceof OneOfDefinition) {
|
|
24466
|
-
return oneOfValues(def,
|
|
24959
|
+
return oneOfValues(def, schema3.definitions, indentation, mode, tokenStructure, schema3);
|
|
24467
24960
|
}
|
|
24468
24961
|
if (def instanceof BooleanDefinition) {
|
|
24469
24962
|
return stringsToValues(["true", "false"]);
|
|
@@ -24477,9 +24970,9 @@ function definitionValues(def, indentation, mode, tokenStructure) {
|
|
|
24477
24970
|
];
|
|
24478
24971
|
}
|
|
24479
24972
|
if (def instanceof SequenceDefinition) {
|
|
24480
|
-
const itemDef =
|
|
24973
|
+
const itemDef = schema3.getDefinition(def.itemType);
|
|
24481
24974
|
if (itemDef) {
|
|
24482
|
-
return definitionValues(itemDef, indentation, mode);
|
|
24975
|
+
return definitionValues(itemDef, indentation, mode, void 0, schema3);
|
|
24483
24976
|
}
|
|
24484
24977
|
}
|
|
24485
24978
|
return [];
|
|
@@ -24542,7 +25035,7 @@ ${indentation}${key}: `;
|
|
|
24542
25035
|
}
|
|
24543
25036
|
return properties;
|
|
24544
25037
|
}
|
|
24545
|
-
function oneOfValues(oneOfDefinition, definitions, indentation, mode, tokenStructure) {
|
|
25038
|
+
function oneOfValues(oneOfDefinition, definitions, indentation, mode, tokenStructure, schema3) {
|
|
24546
25039
|
const values = [];
|
|
24547
25040
|
for (const key of oneOfDefinition.oneOf) {
|
|
24548
25041
|
const variantDef = definitions[key];
|
|
@@ -24561,14 +25054,14 @@ function oneOfValues(oneOfDefinition, definitions, indentation, mode, tokenStruc
|
|
|
24561
25054
|
continue;
|
|
24562
25055
|
}
|
|
24563
25056
|
}
|
|
24564
|
-
values.push(...definitionValues(variantDef, indentation, mode, tokenStructure));
|
|
25057
|
+
values.push(...definitionValues(variantDef, indentation, mode, tokenStructure, schema3));
|
|
24565
25058
|
}
|
|
24566
25059
|
return distinctValues(values);
|
|
24567
25060
|
}
|
|
24568
25061
|
function distinctValues(values) {
|
|
24569
25062
|
const map = /* @__PURE__ */ new Map();
|
|
24570
25063
|
for (const value of values) {
|
|
24571
|
-
const key = value.
|
|
25064
|
+
const key = value.labelDetail ? `${value.label}\0${value.labelDetail}` : value.label;
|
|
24572
25065
|
map.set(key, value);
|
|
24573
25066
|
}
|
|
24574
25067
|
return Array.from(map.values());
|
|
@@ -24621,7 +25114,7 @@ ${indentation}- `;
|
|
|
24621
25114
|
results.push({
|
|
24622
25115
|
label: key,
|
|
24623
25116
|
description,
|
|
24624
|
-
|
|
25117
|
+
labelDetail: needsQualifier ? "list" : void 0,
|
|
24625
25118
|
insertText,
|
|
24626
25119
|
sortText: needsQualifier ? `${key} 1` : void 0
|
|
24627
25120
|
});
|
|
@@ -24634,7 +25127,7 @@ ${indentation}`;
|
|
|
24634
25127
|
results.push({
|
|
24635
25128
|
label: key,
|
|
24636
25129
|
description,
|
|
24637
|
-
|
|
25130
|
+
labelDetail: needsQualifier ? "full syntax" : void 0,
|
|
24638
25131
|
insertText,
|
|
24639
25132
|
sortText: needsQualifier ? `${key} 2` : void 0
|
|
24640
25133
|
});
|
|
@@ -24665,27 +25158,34 @@ async function complete2(textDocument, position, config) {
|
|
|
24665
25158
|
name: textDocument.uri,
|
|
24666
25159
|
content: newDoc.getText()
|
|
24667
25160
|
};
|
|
24668
|
-
const
|
|
24669
|
-
|
|
25161
|
+
const isAction = detectDocumentType(textDocument.uri) === "action";
|
|
25162
|
+
const parsedTemplate = isAction ? getOrParseAction(file, textDocument.uri, true) : getOrParseWorkflow(file, textDocument.uri, true);
|
|
25163
|
+
if (!parsedTemplate.value) {
|
|
24670
25164
|
return [];
|
|
24671
25165
|
}
|
|
24672
|
-
const
|
|
24673
|
-
|
|
24674
|
-
|
|
24675
|
-
|
|
24676
|
-
|
|
24677
|
-
|
|
24678
|
-
|
|
24679
|
-
|
|
24680
|
-
|
|
24681
|
-
|
|
24682
|
-
|
|
24683
|
-
}
|
|
25166
|
+
const schema3 = isAction ? getActionSchema() : getWorkflowSchema();
|
|
25167
|
+
const { token, keyToken, parent, path } = findToken(newPos, parsedTemplate.value);
|
|
25168
|
+
let workflowContext;
|
|
25169
|
+
let actionContext;
|
|
25170
|
+
if (isAction) {
|
|
25171
|
+
const actionTemplate = getOrConvertActionTemplate(parsedTemplate.context, parsedTemplate.value, textDocument.uri, { errorPolicy: ErrorPolicy.TryConversion }, true);
|
|
25172
|
+
actionContext = getActionContext(textDocument.uri, actionTemplate, path);
|
|
25173
|
+
} else {
|
|
25174
|
+
const workflowTemplate = await getOrConvertWorkflowTemplate(parsedTemplate.context, parsedTemplate.value, textDocument.uri, config, {
|
|
25175
|
+
fetchReusableWorkflowDepth: config?.fileProvider ? 1 : 0,
|
|
25176
|
+
errorPolicy: ErrorPolicy.TryConversion
|
|
25177
|
+
}, true);
|
|
25178
|
+
workflowContext = workflowTemplate ? getWorkflowContext(textDocument.uri, workflowTemplate, path) : void 0;
|
|
25179
|
+
}
|
|
25180
|
+
if (token && (isBasicExpression(token) || isPotentiallyExpression(token))) {
|
|
25181
|
+
const allowedContext = token.definitionInfo?.allowedContext || [];
|
|
25182
|
+
const context = isAction ? getActionExpressionContext(allowedContext, config?.contextProviderConfig, actionContext, Mode.Completion) : await getWorkflowExpressionContext(allowedContext, config?.contextProviderConfig, workflowContext, Mode.Completion);
|
|
25183
|
+
return getExpressionCompletionItems(token, context, newPos);
|
|
24684
25184
|
}
|
|
24685
25185
|
const indentation = guessIndentation(newDoc, 2, true);
|
|
24686
25186
|
const indentString = " ".repeat(indentation.tabSize);
|
|
24687
|
-
const values = await getValues(token, keyToken, parent, config?.valueProviderConfig, workflowContext, indentString);
|
|
24688
|
-
const escapeHatches = getEscapeHatchCompletions(token, keyToken, indentString, newPos);
|
|
25187
|
+
const values = await getValues(token, keyToken, parent, config?.valueProviderConfig, workflowContext, indentString, schema3);
|
|
25188
|
+
const escapeHatches = getEscapeHatchCompletions(token, keyToken, indentString, newPos, schema3);
|
|
24689
25189
|
values.push(...escapeHatches);
|
|
24690
25190
|
let replaceRange;
|
|
24691
25191
|
if (token?.range) {
|
|
@@ -24715,7 +25215,7 @@ async function complete2(textDocument, position, config) {
|
|
|
24715
25215
|
}
|
|
24716
25216
|
const item = {
|
|
24717
25217
|
label: value.label,
|
|
24718
|
-
|
|
25218
|
+
labelDetails: value.labelDetail ? { description: value.labelDetail } : void 0,
|
|
24719
25219
|
filterText: value.filterText,
|
|
24720
25220
|
sortText: value.sortText,
|
|
24721
25221
|
documentation: value.description && {
|
|
@@ -24728,30 +25228,32 @@ async function complete2(textDocument, position, config) {
|
|
|
24728
25228
|
return item;
|
|
24729
25229
|
});
|
|
24730
25230
|
}
|
|
24731
|
-
async function getValues(token, keyToken, parent, valueProviderConfig, workflowContext, indentation) {
|
|
25231
|
+
async function getValues(token, keyToken, parent, valueProviderConfig, workflowContext, indentation, schema3) {
|
|
24732
25232
|
if (!parent) {
|
|
24733
25233
|
return [];
|
|
24734
25234
|
}
|
|
24735
25235
|
const existingValues = getExistingValues(token, parent);
|
|
24736
25236
|
const valueProviderToken = keyToken || parent;
|
|
24737
|
-
|
|
24738
|
-
|
|
24739
|
-
|
|
24740
|
-
|
|
24741
|
-
|
|
25237
|
+
if (workflowContext) {
|
|
25238
|
+
const customValueProvider = valueProviderToken?.definition?.key && valueProviderConfig?.[valueProviderToken.definition.key];
|
|
25239
|
+
if (customValueProvider) {
|
|
25240
|
+
const customValues = await customValueProvider.get(workflowContext, existingValues);
|
|
25241
|
+
if (customValues) {
|
|
25242
|
+
return filterAndSortCompletionOptions(customValues, existingValues);
|
|
25243
|
+
}
|
|
25244
|
+
}
|
|
25245
|
+
const defaultValueProvider = valueProviderToken?.definition?.key && defaultValueProviders[valueProviderToken.definition.key];
|
|
25246
|
+
if (defaultValueProvider) {
|
|
25247
|
+
const values2 = await defaultValueProvider.get(workflowContext, existingValues);
|
|
25248
|
+
return filterAndSortCompletionOptions(values2, existingValues);
|
|
24742
25249
|
}
|
|
24743
|
-
}
|
|
24744
|
-
const defaultValueProvider = valueProviderToken?.definition?.key && defaultValueProviders[valueProviderToken.definition.key];
|
|
24745
|
-
if (defaultValueProvider) {
|
|
24746
|
-
const values2 = await defaultValueProvider.get(workflowContext, existingValues);
|
|
24747
|
-
return filterAndSortCompletionOptions(values2, existingValues);
|
|
24748
25250
|
}
|
|
24749
25251
|
const def = keyToken?.definition || parent.definition;
|
|
24750
25252
|
if (!def) {
|
|
24751
25253
|
return [];
|
|
24752
25254
|
}
|
|
24753
25255
|
const tokenStructure = getTokenStructure(token);
|
|
24754
|
-
const values = definitionValues(def, indentation, keyToken ? DefinitionValueMode.Key : DefinitionValueMode.Parent, tokenStructure);
|
|
25256
|
+
const values = definitionValues(def, indentation, keyToken ? DefinitionValueMode.Key : DefinitionValueMode.Parent, tokenStructure, schema3);
|
|
24755
25257
|
return filterAndSortCompletionOptions(values, existingValues);
|
|
24756
25258
|
}
|
|
24757
25259
|
function getTokenStructure(token) {
|
|
@@ -24779,7 +25281,7 @@ function getTokenStructure(token) {
|
|
|
24779
25281
|
return void 0;
|
|
24780
25282
|
}
|
|
24781
25283
|
}
|
|
24782
|
-
function getEscapeHatchCompletions(token, keyToken, indentation, position) {
|
|
25284
|
+
function getEscapeHatchCompletions(token, keyToken, indentation, position, schema3) {
|
|
24783
25285
|
const tokenStructure = getTokenStructure(token);
|
|
24784
25286
|
if (tokenStructure !== void 0) {
|
|
24785
25287
|
return [];
|
|
@@ -24788,14 +25290,13 @@ function getEscapeHatchCompletions(token, keyToken, indentation, position) {
|
|
|
24788
25290
|
return [];
|
|
24789
25291
|
}
|
|
24790
25292
|
const def = keyToken.definition;
|
|
24791
|
-
const schema2 = getWorkflowSchema();
|
|
24792
25293
|
const buckets = {
|
|
24793
25294
|
sequence: false,
|
|
24794
25295
|
mapping: false
|
|
24795
25296
|
};
|
|
24796
25297
|
if (def instanceof OneOfDefinition) {
|
|
24797
25298
|
for (const variantKey of def.oneOf) {
|
|
24798
|
-
const variantDef =
|
|
25299
|
+
const variantDef = schema3.definitions[variantKey];
|
|
24799
25300
|
if (variantDef) {
|
|
24800
25301
|
switch (variantDef.definitionType) {
|
|
24801
25302
|
case DefinitionType.Sequence:
|
|
@@ -25310,11 +25811,43 @@ async function documentLinks(document, workspace) {
|
|
|
25310
25811
|
name: document.uri,
|
|
25311
25812
|
content: document.getText()
|
|
25312
25813
|
};
|
|
25313
|
-
|
|
25814
|
+
return isActionDocument(document.uri) ? actionDocumentLinks(file, document.uri) : workflowDocumentLinks(file, document.uri, workspace);
|
|
25815
|
+
}
|
|
25816
|
+
function actionDocumentLinks(file, uri) {
|
|
25817
|
+
const parsedAction = getOrParseAction(file, uri);
|
|
25818
|
+
if (!parsedAction?.value) {
|
|
25819
|
+
return [];
|
|
25820
|
+
}
|
|
25821
|
+
const template = getOrConvertActionTemplate(parsedAction.context, parsedAction.value, uri, {
|
|
25822
|
+
errorPolicy: ErrorPolicy.TryConversion
|
|
25823
|
+
});
|
|
25824
|
+
const links = [];
|
|
25825
|
+
if (template?.runs?.using !== "composite") {
|
|
25826
|
+
return links;
|
|
25827
|
+
}
|
|
25828
|
+
const steps = template.runs.steps ?? [];
|
|
25829
|
+
for (const step of steps) {
|
|
25830
|
+
if ("uses" in step) {
|
|
25831
|
+
const actionRef = parseActionReference(step.uses.value);
|
|
25832
|
+
if (!actionRef) {
|
|
25833
|
+
continue;
|
|
25834
|
+
}
|
|
25835
|
+
const url = actionUrl(actionRef);
|
|
25836
|
+
links.push({
|
|
25837
|
+
range: mapRange(step.uses.range),
|
|
25838
|
+
target: url,
|
|
25839
|
+
tooltip: `Open action on GitHub`
|
|
25840
|
+
});
|
|
25841
|
+
}
|
|
25842
|
+
}
|
|
25843
|
+
return links;
|
|
25844
|
+
}
|
|
25845
|
+
async function workflowDocumentLinks(file, uri, workspace) {
|
|
25846
|
+
const parsedWorkflow = getOrParseWorkflow(file, uri);
|
|
25314
25847
|
if (!parsedWorkflow?.value) {
|
|
25315
25848
|
return [];
|
|
25316
25849
|
}
|
|
25317
|
-
const template = await
|
|
25850
|
+
const template = await getOrConvertWorkflowTemplate(parsedWorkflow.context, parsedWorkflow.value, uri, void 0, {
|
|
25318
25851
|
errorPolicy: ErrorPolicy.TryConversion
|
|
25319
25852
|
});
|
|
25320
25853
|
const links = [];
|
|
@@ -25556,50 +26089,51 @@ async function hover(document, position, config) {
|
|
|
25556
26089
|
name: document.uri,
|
|
25557
26090
|
content: document.getText()
|
|
25558
26091
|
};
|
|
25559
|
-
const
|
|
25560
|
-
|
|
26092
|
+
const isAction = isActionDocument(document.uri);
|
|
26093
|
+
const parsedTemplate = isAction ? parseAction(file, nullTrace) : getOrParseWorkflow(file, document.uri);
|
|
26094
|
+
if (!parsedTemplate?.value) {
|
|
25561
26095
|
return null;
|
|
25562
26096
|
}
|
|
25563
|
-
const
|
|
25564
|
-
errorPolicy: ErrorPolicy.TryConversion,
|
|
25565
|
-
fetchReusableWorkflowDepth: config?.fileProvider ? 1 : 0
|
|
25566
|
-
});
|
|
25567
|
-
const tokenResult = findToken(position, parsedWorkflow.value);
|
|
26097
|
+
const tokenResult = findToken(position, parsedTemplate.value);
|
|
25568
26098
|
const { token, keyToken, parent } = tokenResult;
|
|
25569
26099
|
const tokenDefinitionInfo = (keyToken || parent || token)?.definitionInfo;
|
|
25570
|
-
const
|
|
25571
|
-
|
|
25572
|
-
|
|
25573
|
-
|
|
25574
|
-
|
|
25575
|
-
|
|
25576
|
-
|
|
25577
|
-
|
|
25578
|
-
|
|
25579
|
-
|
|
25580
|
-
|
|
25581
|
-
|
|
25582
|
-
|
|
25583
|
-
|
|
26100
|
+
const hoverToken = token || keyToken;
|
|
26101
|
+
const isExpressionHover = token && tokenDefinitionInfo && (isBasicExpression(token) || isPotentiallyExpression(token));
|
|
26102
|
+
if (!isExpressionHover && !hoverToken?.definition) {
|
|
26103
|
+
return null;
|
|
26104
|
+
}
|
|
26105
|
+
const documentContext = isAction ? getActionContext(document.uri, getOrConvertActionTemplate(parsedTemplate.context, parsedTemplate.value, document.uri, {
|
|
26106
|
+
errorPolicy: ErrorPolicy.TryConversion
|
|
26107
|
+
}), tokenResult.path) : getWorkflowContext(document.uri, await getOrConvertWorkflowTemplate(parsedTemplate.context, parsedTemplate.value, document.uri, config, {
|
|
26108
|
+
errorPolicy: ErrorPolicy.TryConversion,
|
|
26109
|
+
fetchReusableWorkflowDepth: config?.fileProvider ? 1 : 0
|
|
26110
|
+
}), tokenResult.path);
|
|
26111
|
+
if (isExpressionHover) {
|
|
26112
|
+
info(`Calculating expression hover for token with definition ${tokenDefinitionInfo.definition.key}`);
|
|
26113
|
+
const allowedContext = tokenDefinitionInfo.allowedContext || [];
|
|
26114
|
+
const { namedContexts, functions } = splitAllowedContext(allowedContext);
|
|
26115
|
+
const expressionContext = isAction ? getActionExpressionContext(namedContexts, config?.contextProviderConfig, documentContext, Mode.Hover) : await getWorkflowExpressionContext(namedContexts, config?.contextProviderConfig, documentContext, Mode.Hover);
|
|
26116
|
+
for (const func of functions) {
|
|
26117
|
+
func.description = getFunctionDescription(func.name);
|
|
26118
|
+
}
|
|
26119
|
+
const exprPos = mapToExpressionPos(token, position);
|
|
26120
|
+
if (exprPos) {
|
|
26121
|
+
return expressionHover(exprPos, expressionContext, namedContexts, functions);
|
|
25584
26122
|
}
|
|
25585
26123
|
}
|
|
25586
|
-
if (!
|
|
26124
|
+
if (!hoverToken?.definition) {
|
|
25587
26125
|
return null;
|
|
25588
26126
|
}
|
|
25589
|
-
info(`Calculating hover for token with definition ${
|
|
25590
|
-
|
|
25591
|
-
|
|
25592
|
-
|
|
25593
|
-
|
|
25594
|
-
|
|
25595
|
-
range: mapRange(token.range)
|
|
25596
|
-
};
|
|
26127
|
+
info(`Calculating hover for token with definition ${hoverToken.definition.key}`);
|
|
26128
|
+
let description;
|
|
26129
|
+
if (!isAction && tokenResult.parent && isReusableWorkflowJobInput(tokenResult)) {
|
|
26130
|
+
description = getReusableWorkflowInputDescription(documentContext, tokenResult);
|
|
26131
|
+
} else {
|
|
26132
|
+
description = await getDescription2(config, documentContext, hoverToken, tokenResult.path) || hoverToken.description || "";
|
|
25597
26133
|
}
|
|
25598
|
-
let description = await getDescription2(config, workflowContext, token, tokenResult.path);
|
|
25599
|
-
description = appendContext(description, token.definitionInfo?.allowedContext);
|
|
25600
26134
|
return {
|
|
25601
|
-
contents: description,
|
|
25602
|
-
range: mapRange(
|
|
26135
|
+
contents: appendContext(description, hoverToken.definitionInfo?.allowedContext),
|
|
26136
|
+
range: mapRange(hoverToken.range)
|
|
25603
26137
|
};
|
|
25604
26138
|
}
|
|
25605
26139
|
function appendContext(description, allowedContext) {
|
|
@@ -25621,15 +26155,13 @@ function appendContext(description, allowedContext) {
|
|
|
25621
26155
|
}
|
|
25622
26156
|
return `${description}${namedContextsString}${functionsString}`;
|
|
25623
26157
|
}
|
|
25624
|
-
async function getDescription2(config,
|
|
25625
|
-
const defaultDescription = token.description || "";
|
|
26158
|
+
async function getDescription2(config, documentContext, token, path) {
|
|
25626
26159
|
if (!config?.descriptionProvider) {
|
|
25627
|
-
return
|
|
26160
|
+
return void 0;
|
|
25628
26161
|
}
|
|
25629
|
-
|
|
25630
|
-
return description || defaultDescription;
|
|
26162
|
+
return await config.descriptionProvider.getDescription(documentContext, token, path);
|
|
25631
26163
|
}
|
|
25632
|
-
function expressionHover(exprPos,
|
|
26164
|
+
function expressionHover(exprPos, expressionContext, namedContexts, functions) {
|
|
25633
26165
|
const { expression, position, documentRange } = exprPos;
|
|
25634
26166
|
try {
|
|
25635
26167
|
const l = new Lexer(expression);
|
|
@@ -25643,7 +26175,7 @@ function expressionHover(exprPos, context, namedContexts, functions) {
|
|
|
25643
26175
|
call: () => new data_exports.Null()
|
|
25644
26176
|
});
|
|
25645
26177
|
}
|
|
25646
|
-
const hv = new HoverVisitor(position,
|
|
26178
|
+
const hv = new HoverVisitor(position, expressionContext, functionMap);
|
|
25647
26179
|
const hoverResult = hv.hover(expr);
|
|
25648
26180
|
if (!hoverResult) {
|
|
25649
26181
|
return null;
|
|
@@ -25672,11 +26204,14 @@ function expressionHover(exprPos, context, namedContexts, functions) {
|
|
|
25672
26204
|
// ../languageservice/dist/inlay-hints.js
|
|
25673
26205
|
var import_vscode_languageserver_types2 = __toESM(require_main2(), 1);
|
|
25674
26206
|
function getInlayHints(document) {
|
|
26207
|
+
if (isActionDocument(document.uri)) {
|
|
26208
|
+
return [];
|
|
26209
|
+
}
|
|
25675
26210
|
const file = {
|
|
25676
26211
|
name: document.uri,
|
|
25677
26212
|
content: document.getText()
|
|
25678
26213
|
};
|
|
25679
|
-
const result =
|
|
26214
|
+
const result = getOrParseWorkflow(file, document.uri);
|
|
25680
26215
|
if (!result?.value) {
|
|
25681
26216
|
return [];
|
|
25682
26217
|
}
|
|
@@ -25705,7 +26240,7 @@ function getInlayHints(document) {
|
|
|
25705
26240
|
}
|
|
25706
26241
|
|
|
25707
26242
|
// ../languageservice/dist/validate.js
|
|
25708
|
-
var
|
|
26243
|
+
var import_vscode_languageserver_types5 = __toESM(require_main2(), 1);
|
|
25709
26244
|
|
|
25710
26245
|
// ../languageservice/dist/expression-validation/error-dictionary.js
|
|
25711
26246
|
var AccessError = class extends Error {
|
|
@@ -25783,9 +26318,9 @@ var ValidationEvaluator = class extends Evaluator {
|
|
|
25783
26318
|
}
|
|
25784
26319
|
};
|
|
25785
26320
|
|
|
25786
|
-
// ../languageservice/dist/validate-action.js
|
|
26321
|
+
// ../languageservice/dist/validate-action-reference.js
|
|
25787
26322
|
var import_vscode_languageserver_types3 = __toESM(require_main2(), 1);
|
|
25788
|
-
async function
|
|
26323
|
+
async function validateActionReference(diagnostics, stepToken, step, config) {
|
|
25789
26324
|
if (!isMapping(stepToken) || !step || !isActionStep(step) || !config?.actionsMetadataProvider) {
|
|
25790
26325
|
return;
|
|
25791
26326
|
}
|
|
@@ -25849,21 +26384,81 @@ async function validateAction(diagnostics, stepToken, step, config) {
|
|
|
25849
26384
|
}
|
|
25850
26385
|
}
|
|
25851
26386
|
|
|
26387
|
+
// ../languageservice/dist/validate-action.js
|
|
26388
|
+
var import_vscode_languageserver_types4 = __toESM(require_main2(), 1);
|
|
26389
|
+
async function validateAction(textDocument, config) {
|
|
26390
|
+
const file = {
|
|
26391
|
+
name: textDocument.uri,
|
|
26392
|
+
content: textDocument.getText()
|
|
26393
|
+
};
|
|
26394
|
+
const diagnostics = [];
|
|
26395
|
+
try {
|
|
26396
|
+
const result = getOrParseAction(file, textDocument.uri);
|
|
26397
|
+
if (!result) {
|
|
26398
|
+
return [];
|
|
26399
|
+
}
|
|
26400
|
+
for (const err of result.context.errors.getErrors()) {
|
|
26401
|
+
const range = mapRange(err.range);
|
|
26402
|
+
let severity = import_vscode_languageserver_types4.DiagnosticSeverity.Error;
|
|
26403
|
+
if (err.rawMessage.includes("deprecated")) {
|
|
26404
|
+
severity = import_vscode_languageserver_types4.DiagnosticSeverity.Warning;
|
|
26405
|
+
}
|
|
26406
|
+
diagnostics.push({
|
|
26407
|
+
message: err.rawMessage,
|
|
26408
|
+
range,
|
|
26409
|
+
severity
|
|
26410
|
+
});
|
|
26411
|
+
}
|
|
26412
|
+
if (result.value) {
|
|
26413
|
+
const template = getOrConvertActionTemplate(result.context, result.value, textDocument.uri, {
|
|
26414
|
+
errorPolicy: ErrorPolicy.TryConversion
|
|
26415
|
+
});
|
|
26416
|
+
if (template?.runs?.using === "composite") {
|
|
26417
|
+
const steps = template.runs.steps ?? [];
|
|
26418
|
+
const stepsSequence = findStepsSequence(result.value);
|
|
26419
|
+
if (stepsSequence) {
|
|
26420
|
+
for (let i = 0; i < steps.length; i++) {
|
|
26421
|
+
const step = steps[i];
|
|
26422
|
+
const stepToken = stepsSequence.get(i);
|
|
26423
|
+
if (isActionStep(step) && isMapping(stepToken)) {
|
|
26424
|
+
await validateActionReference(diagnostics, stepToken, step, config);
|
|
26425
|
+
}
|
|
26426
|
+
}
|
|
26427
|
+
}
|
|
26428
|
+
}
|
|
26429
|
+
}
|
|
26430
|
+
} catch (e) {
|
|
26431
|
+
error(`Unhandled error while validating action file: ${e.message}`);
|
|
26432
|
+
}
|
|
26433
|
+
return diagnostics;
|
|
26434
|
+
}
|
|
26435
|
+
function findStepsSequence(root) {
|
|
26436
|
+
for (const [, token] of TemplateToken.traverse(root)) {
|
|
26437
|
+
if (token.definition?.key === "composite-steps" && token instanceof SequenceToken) {
|
|
26438
|
+
return token;
|
|
26439
|
+
}
|
|
26440
|
+
}
|
|
26441
|
+
return void 0;
|
|
26442
|
+
}
|
|
26443
|
+
|
|
25852
26444
|
// ../languageservice/dist/validate.js
|
|
25853
26445
|
var CRON_SCHEDULE_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#onschedule";
|
|
25854
26446
|
async function validate(textDocument, config) {
|
|
26447
|
+
return isActionDocument(textDocument.uri) ? validateAction(textDocument, config) : validateWorkflow(textDocument, config);
|
|
26448
|
+
}
|
|
26449
|
+
async function validateWorkflow(textDocument, config) {
|
|
25855
26450
|
const file = {
|
|
25856
26451
|
name: textDocument.uri,
|
|
25857
26452
|
content: textDocument.getText()
|
|
25858
26453
|
};
|
|
25859
26454
|
const diagnostics = [];
|
|
25860
26455
|
try {
|
|
25861
|
-
const result =
|
|
26456
|
+
const result = getOrParseWorkflow(file, textDocument.uri);
|
|
25862
26457
|
if (!result) {
|
|
25863
26458
|
return [];
|
|
25864
26459
|
}
|
|
25865
26460
|
if (result.value) {
|
|
25866
|
-
const template = await
|
|
26461
|
+
const template = await getOrConvertWorkflowTemplate(result.context, result.value, textDocument.uri, config, {
|
|
25867
26462
|
fetchReusableWorkflowDepth: config?.fileProvider ? 1 : 0,
|
|
25868
26463
|
errorPolicy: ErrorPolicy.TryConversion
|
|
25869
26464
|
});
|
|
@@ -25902,7 +26497,7 @@ async function additionalValidations(diagnostics, documentUri, template, root, c
|
|
|
25902
26497
|
}
|
|
25903
26498
|
if (token.definition?.key === "regular-step" && token.range) {
|
|
25904
26499
|
const context = getProviderContext(documentUri, template, root, token.range);
|
|
25905
|
-
await
|
|
26500
|
+
await validateActionReference(diagnostics, token, context.step, config);
|
|
25906
26501
|
}
|
|
25907
26502
|
if (isString(token) && token.range && key && isString(key) && key.value === "uses" && parent?.definition?.key === "workflow-job") {
|
|
25908
26503
|
validateWorkflowUsesFormat(diagnostics, token);
|
|
@@ -25941,7 +26536,7 @@ function invalidValue(diagnostics, token, kind) {
|
|
|
25941
26536
|
case ValueProviderKind.AllowedValues:
|
|
25942
26537
|
diagnostics.push({
|
|
25943
26538
|
message: `Value '${token.value}' is not valid`,
|
|
25944
|
-
severity:
|
|
26539
|
+
severity: import_vscode_languageserver_types5.DiagnosticSeverity.Error,
|
|
25945
26540
|
range: mapRange(token.range)
|
|
25946
26541
|
});
|
|
25947
26542
|
break;
|
|
@@ -25960,7 +26555,7 @@ function validateCronExpression(diagnostics, token) {
|
|
|
25960
26555
|
diagnostics.push({
|
|
25961
26556
|
message: `Actions schedules run at most every 5 minutes. "${cronValue}" (${description.toLowerCase()}) will not run as frequently as specified.`,
|
|
25962
26557
|
range: mapRange(token.range),
|
|
25963
|
-
severity:
|
|
26558
|
+
severity: import_vscode_languageserver_types5.DiagnosticSeverity.Warning,
|
|
25964
26559
|
code: "on-schedule",
|
|
25965
26560
|
codeDescription: {
|
|
25966
26561
|
href: CRON_SCHEDULE_DOCS_URL
|
|
@@ -25974,7 +26569,7 @@ function warnIfShortSha(diagnostics, token, ref) {
|
|
|
25974
26569
|
if (SHORT_SHA_PATTERN.test(ref)) {
|
|
25975
26570
|
diagnostics.push({
|
|
25976
26571
|
message: `The provided ref '${ref}' may be a shortened commit SHA. If so, please use the full 40-character commit SHA instead, as short SHAs are not supported.`,
|
|
25977
|
-
severity:
|
|
26572
|
+
severity: import_vscode_languageserver_types5.DiagnosticSeverity.Warning,
|
|
25978
26573
|
range: mapRange(token.range),
|
|
25979
26574
|
code: "short-sha-ref",
|
|
25980
26575
|
codeDescription: {
|
|
@@ -25990,7 +26585,7 @@ function validateStepUsesFormat(diagnostics, token) {
|
|
|
25990
26585
|
if (!uses) {
|
|
25991
26586
|
diagnostics.push({
|
|
25992
26587
|
message: "`uses' value in action cannot be blank",
|
|
25993
|
-
severity:
|
|
26588
|
+
severity: import_vscode_languageserver_types5.DiagnosticSeverity.Error,
|
|
25994
26589
|
range: mapRange(token.range),
|
|
25995
26590
|
code: "invalid-uses-format"
|
|
25996
26591
|
});
|
|
@@ -26020,7 +26615,7 @@ function validateStepUsesFormat(diagnostics, token) {
|
|
|
26020
26615
|
if (pathSegments.length >= 4 && pathSegments[2] === ".github" && pathSegments[3] === "workflows") {
|
|
26021
26616
|
diagnostics.push({
|
|
26022
26617
|
message: "Reusable workflows should be referenced at the top-level `jobs.<job_id>.uses` key, not within steps",
|
|
26023
|
-
severity:
|
|
26618
|
+
severity: import_vscode_languageserver_types5.DiagnosticSeverity.Error,
|
|
26024
26619
|
range: mapRange(token.range),
|
|
26025
26620
|
code: "invalid-uses-format"
|
|
26026
26621
|
});
|
|
@@ -26031,7 +26626,7 @@ function validateStepUsesFormat(diagnostics, token) {
|
|
|
26031
26626
|
function addStepUsesFormatError(diagnostics, token) {
|
|
26032
26627
|
diagnostics.push({
|
|
26033
26628
|
message: `Expected format {owner}/{repo}[/path]@{ref}. Actual '${token.value}'`,
|
|
26034
|
-
severity:
|
|
26629
|
+
severity: import_vscode_languageserver_types5.DiagnosticSeverity.Error,
|
|
26035
26630
|
range: mapRange(token.range),
|
|
26036
26631
|
code: "invalid-uses-format"
|
|
26037
26632
|
});
|
|
@@ -26120,7 +26715,7 @@ function validateWorkflowUsesFormat(diagnostics, token) {
|
|
|
26120
26715
|
function addWorkflowUsesFormatError(diagnostics, token, reason) {
|
|
26121
26716
|
diagnostics.push({
|
|
26122
26717
|
message: `Invalid workflow reference '${token.value}': ${reason}`,
|
|
26123
|
-
severity:
|
|
26718
|
+
severity: import_vscode_languageserver_types5.DiagnosticSeverity.Error,
|
|
26124
26719
|
range: mapRange(token.range),
|
|
26125
26720
|
code: "invalid-workflow-uses-format"
|
|
26126
26721
|
});
|
|
@@ -26216,7 +26811,7 @@ async function validateExpression(diagnostics, token, allowedContext, contextPro
|
|
|
26216
26811
|
diagnostics.push({
|
|
26217
26812
|
message: "Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?",
|
|
26218
26813
|
range: mapRange(token.range),
|
|
26219
|
-
severity:
|
|
26814
|
+
severity: import_vscode_languageserver_types5.DiagnosticSeverity.Error,
|
|
26220
26815
|
code: "expression-literal-text-in-condition"
|
|
26221
26816
|
});
|
|
26222
26817
|
}
|
|
@@ -26233,13 +26828,13 @@ async function validateExpression(diagnostics, token, allowedContext, contextPro
|
|
|
26233
26828
|
} catch {
|
|
26234
26829
|
continue;
|
|
26235
26830
|
}
|
|
26236
|
-
const context = await
|
|
26831
|
+
const context = await getWorkflowExpressionContext(namedContexts, contextProviderConfig, workflowContext, Mode.Validation);
|
|
26237
26832
|
const e = new ValidationEvaluator(expr, wrapDictionary(context), validatorFunctions);
|
|
26238
26833
|
e.validate();
|
|
26239
26834
|
diagnostics.push(...e.errors.map((e2) => ({
|
|
26240
26835
|
message: e2.message,
|
|
26241
26836
|
range: mapRange(expression.range),
|
|
26242
|
-
severity: e2.severity === "error" ?
|
|
26837
|
+
severity: e2.severity === "error" ? import_vscode_languageserver_types5.DiagnosticSeverity.Error : import_vscode_languageserver_types5.DiagnosticSeverity.Warning
|
|
26243
26838
|
})));
|
|
26244
26839
|
}
|
|
26245
26840
|
}
|
|
@@ -26261,14 +26856,14 @@ function validateConcurrencyDeadlock(diagnostics, template) {
|
|
|
26261
26856
|
diagnostics.push({
|
|
26262
26857
|
message: `Concurrency group '${workflowGroup.value}' is also used by job '${job.id.value}'. This will cause a deadlock.`,
|
|
26263
26858
|
range: mapRange(template.concurrency.range),
|
|
26264
|
-
severity:
|
|
26859
|
+
severity: import_vscode_languageserver_types5.DiagnosticSeverity.Error
|
|
26265
26860
|
});
|
|
26266
26861
|
}
|
|
26267
26862
|
if (job.concurrency.range) {
|
|
26268
26863
|
diagnostics.push({
|
|
26269
26864
|
message: `Concurrency group '${jobGroup.value}' is also defined at the workflow level. This will cause a deadlock.`,
|
|
26270
26865
|
range: mapRange(job.concurrency.range),
|
|
26271
|
-
severity:
|
|
26866
|
+
severity: import_vscode_languageserver_types5.DiagnosticSeverity.Error
|
|
26272
26867
|
});
|
|
26273
26868
|
}
|
|
26274
26869
|
}
|
|
@@ -30323,7 +30918,7 @@ function contextProviders(client, repo, cache) {
|
|
|
30323
30918
|
}
|
|
30324
30919
|
};
|
|
30325
30920
|
}
|
|
30326
|
-
const
|
|
30921
|
+
const getContext = async (name, defaultContext, workflowContext, mode) => {
|
|
30327
30922
|
switch (name) {
|
|
30328
30923
|
case "secrets":
|
|
30329
30924
|
return await getSecrets(workflowContext, client, cache, repo, defaultContext, mode);
|
|
@@ -30333,7 +30928,7 @@ function contextProviders(client, repo, cache) {
|
|
|
30333
30928
|
return await getStepsContext2(client, cache, defaultContext, workflowContext);
|
|
30334
30929
|
}
|
|
30335
30930
|
};
|
|
30336
|
-
return { getContext
|
|
30931
|
+
return { getContext };
|
|
30337
30932
|
}
|
|
30338
30933
|
|
|
30339
30934
|
// src/description-providers/action-description.ts
|
|
@@ -30462,7 +31057,7 @@ var Requests = {
|
|
|
30462
31057
|
};
|
|
30463
31058
|
|
|
30464
31059
|
// src/value-providers/action-inputs.ts
|
|
30465
|
-
async function
|
|
31060
|
+
async function getActionInputs2(client, cache, action) {
|
|
30466
31061
|
return (await fetchActionMetadata(client, cache, action))?.inputs;
|
|
30467
31062
|
}
|
|
30468
31063
|
async function getActionInputValues(client, cache, context) {
|
|
@@ -30473,7 +31068,7 @@ async function getActionInputValues(client, cache, context) {
|
|
|
30473
31068
|
if (!action) {
|
|
30474
31069
|
return [];
|
|
30475
31070
|
}
|
|
30476
|
-
const inputs2 = await
|
|
31071
|
+
const inputs2 = await getActionInputs2(client, cache, action);
|
|
30477
31072
|
if (!inputs2) {
|
|
30478
31073
|
return [];
|
|
30479
31074
|
}
|