@lvce-editor/eslint-plugin-github-actions 2.21.0 → 2.22.0
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/index.js +114 -62
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38,7 +38,7 @@ const permissions$1 = {
|
|
|
38
38
|
const isSupported = (actions, value) => {
|
|
39
39
|
return actions.includes(value);
|
|
40
40
|
};
|
|
41
|
-
const meta$
|
|
41
|
+
const meta$g = {
|
|
42
42
|
type: 'problem',
|
|
43
43
|
docs: {
|
|
44
44
|
description: 'Disallow unsupported action versions'
|
|
@@ -48,7 +48,7 @@ const meta$f = {
|
|
|
48
48
|
},
|
|
49
49
|
fixable: 'code'
|
|
50
50
|
};
|
|
51
|
-
const create$
|
|
51
|
+
const create$g = context => {
|
|
52
52
|
const sourceCode = getSourceCode(context);
|
|
53
53
|
if (!sourceCode.parserServices?.isYAML) {
|
|
54
54
|
return {};
|
|
@@ -79,8 +79,8 @@ const create$f = context => {
|
|
|
79
79
|
|
|
80
80
|
const actionVersions = {
|
|
81
81
|
__proto__: null,
|
|
82
|
-
create: create$
|
|
83
|
-
meta: meta$
|
|
82
|
+
create: create$g,
|
|
83
|
+
meta: meta$g
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
const parseVersion = value => {
|
|
@@ -104,7 +104,7 @@ const isSupportedMacosversion = version => {
|
|
|
104
104
|
const isSupportedWindowsVersion = version => {
|
|
105
105
|
return config.windows.includes(version);
|
|
106
106
|
};
|
|
107
|
-
const meta$
|
|
107
|
+
const meta$f = {
|
|
108
108
|
type: 'problem',
|
|
109
109
|
docs: {
|
|
110
110
|
description: 'Disallow unsupported ci versions'
|
|
@@ -113,7 +113,7 @@ const meta$e = {
|
|
|
113
113
|
unsupportedCiVersion: 'Unsupported ci version: {{value}}'
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
|
-
const create$
|
|
116
|
+
const create$f = context => {
|
|
117
117
|
const sourceCode = getSourceCode(context);
|
|
118
118
|
if (!sourceCode.parserServices?.isYAML) {
|
|
119
119
|
return {};
|
|
@@ -156,11 +156,11 @@ const create$e = context => {
|
|
|
156
156
|
|
|
157
157
|
const ciVersions = {
|
|
158
158
|
__proto__: null,
|
|
159
|
-
create: create$
|
|
160
|
-
meta: meta$
|
|
159
|
+
create: create$f,
|
|
160
|
+
meta: meta$f
|
|
161
161
|
};
|
|
162
162
|
|
|
163
|
-
const meta$
|
|
163
|
+
const meta$e = {
|
|
164
164
|
type: 'problem',
|
|
165
165
|
docs: {
|
|
166
166
|
description: 'Disallow unsupported fail fast values'
|
|
@@ -169,7 +169,7 @@ const meta$d = {
|
|
|
169
169
|
unsupportedFailFast: 'Unsupported fail fast value: {{value}}'
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
|
-
const create$
|
|
172
|
+
const create$e = context => {
|
|
173
173
|
const sourceCode = getSourceCode(context);
|
|
174
174
|
if (!sourceCode.parserServices?.isYAML) {
|
|
175
175
|
return {};
|
|
@@ -192,11 +192,11 @@ const create$d = context => {
|
|
|
192
192
|
|
|
193
193
|
const failFast = {
|
|
194
194
|
__proto__: null,
|
|
195
|
-
create: create$
|
|
196
|
-
meta: meta$
|
|
195
|
+
create: create$e,
|
|
196
|
+
meta: meta$e
|
|
197
197
|
};
|
|
198
198
|
|
|
199
|
-
const meta$
|
|
199
|
+
const meta$d = {
|
|
200
200
|
type: 'problem',
|
|
201
201
|
docs: {
|
|
202
202
|
description: 'Disallow unsupported matrix values'
|
|
@@ -205,7 +205,7 @@ const meta$c = {
|
|
|
205
205
|
unsupportedMatrix: 'Unsupported matrix value: {{value}}'
|
|
206
206
|
}
|
|
207
207
|
};
|
|
208
|
-
const create$
|
|
208
|
+
const create$d = context => {
|
|
209
209
|
const sourceCode = getSourceCode(context);
|
|
210
210
|
if (!sourceCode.parserServices?.isYAML) {
|
|
211
211
|
return {};
|
|
@@ -227,11 +227,11 @@ const create$c = context => {
|
|
|
227
227
|
|
|
228
228
|
const matrix = {
|
|
229
229
|
__proto__: null,
|
|
230
|
-
create: create$
|
|
231
|
-
meta: meta$
|
|
230
|
+
create: create$d,
|
|
231
|
+
meta: meta$d
|
|
232
232
|
};
|
|
233
233
|
|
|
234
|
-
const meta$
|
|
234
|
+
const meta$c = {
|
|
235
235
|
type: 'problem',
|
|
236
236
|
docs: {
|
|
237
237
|
description: 'Disallow unsupported max parallel values'
|
|
@@ -240,7 +240,7 @@ const meta$b = {
|
|
|
240
240
|
unsupportedMaxParallel: 'Unsupported max parallel value: {{value}}'
|
|
241
241
|
}
|
|
242
242
|
};
|
|
243
|
-
const create$
|
|
243
|
+
const create$c = context => {
|
|
244
244
|
const sourceCode = getSourceCode(context);
|
|
245
245
|
if (!sourceCode.parserServices?.isYAML) {
|
|
246
246
|
return {};
|
|
@@ -263,11 +263,11 @@ const create$b = context => {
|
|
|
263
263
|
|
|
264
264
|
const maxParallel = {
|
|
265
265
|
__proto__: null,
|
|
266
|
-
create: create$
|
|
267
|
-
meta: meta$
|
|
266
|
+
create: create$c,
|
|
267
|
+
meta: meta$c
|
|
268
268
|
};
|
|
269
269
|
|
|
270
|
-
const meta$
|
|
270
|
+
const meta$b = {
|
|
271
271
|
type: 'problem',
|
|
272
272
|
docs: {
|
|
273
273
|
description: 'Disallow unsupported needs values'
|
|
@@ -298,7 +298,7 @@ const getValidNeeds = node => {
|
|
|
298
298
|
}
|
|
299
299
|
return validNeeds;
|
|
300
300
|
};
|
|
301
|
-
const create$
|
|
301
|
+
const create$b = context => {
|
|
302
302
|
const sourceCode = getSourceCode(context);
|
|
303
303
|
if (!sourceCode.parserServices?.isYAML) {
|
|
304
304
|
return {};
|
|
@@ -357,11 +357,11 @@ const create$a = context => {
|
|
|
357
357
|
|
|
358
358
|
const needs = {
|
|
359
359
|
__proto__: null,
|
|
360
|
-
create: create$
|
|
361
|
-
meta: meta$
|
|
360
|
+
create: create$b,
|
|
361
|
+
meta: meta$b
|
|
362
362
|
};
|
|
363
363
|
|
|
364
|
-
const meta$
|
|
364
|
+
const meta$a = {
|
|
365
365
|
type: 'problem',
|
|
366
366
|
docs: {
|
|
367
367
|
description: 'Disallow unsupported node version file values'
|
|
@@ -370,7 +370,7 @@ const meta$9 = {
|
|
|
370
370
|
unsupportedNodeVersionFile: 'Unsupported node version file value: {{value}}'
|
|
371
371
|
}
|
|
372
372
|
};
|
|
373
|
-
const create$
|
|
373
|
+
const create$a = context => {
|
|
374
374
|
const sourceCode = getSourceCode(context);
|
|
375
375
|
if (!sourceCode.parserServices?.isYAML) {
|
|
376
376
|
return {};
|
|
@@ -395,11 +395,11 @@ const create$9 = context => {
|
|
|
395
395
|
|
|
396
396
|
const nodeVersionFile = {
|
|
397
397
|
__proto__: null,
|
|
398
|
-
create: create$
|
|
399
|
-
meta: meta$
|
|
398
|
+
create: create$a,
|
|
399
|
+
meta: meta$a
|
|
400
400
|
};
|
|
401
401
|
|
|
402
|
-
const meta$
|
|
402
|
+
const meta$9 = {
|
|
403
403
|
type: 'problem',
|
|
404
404
|
docs: {
|
|
405
405
|
description: 'Disallow unsupported npm registry values'
|
|
@@ -408,7 +408,7 @@ const meta$8 = {
|
|
|
408
408
|
unsupportedNpmRegistry: 'Unsupported npm registry value: {{value}}'
|
|
409
409
|
}
|
|
410
410
|
};
|
|
411
|
-
const create$
|
|
411
|
+
const create$9 = context => {
|
|
412
412
|
const sourceCode = getSourceCode(context);
|
|
413
413
|
if (!sourceCode.parserServices?.isYAML) {
|
|
414
414
|
return {};
|
|
@@ -433,11 +433,11 @@ const create$8 = context => {
|
|
|
433
433
|
|
|
434
434
|
const npmRegistry = {
|
|
435
435
|
__proto__: null,
|
|
436
|
-
create: create$
|
|
437
|
-
meta: meta$
|
|
436
|
+
create: create$9,
|
|
437
|
+
meta: meta$9
|
|
438
438
|
};
|
|
439
439
|
|
|
440
|
-
const meta$
|
|
440
|
+
const meta$8 = {
|
|
441
441
|
type: 'problem',
|
|
442
442
|
docs: {
|
|
443
443
|
description: 'Disallow unsupported npm commands'
|
|
@@ -454,7 +454,7 @@ const isSupportedNpmCommand = value => {
|
|
|
454
454
|
}
|
|
455
455
|
return false;
|
|
456
456
|
};
|
|
457
|
-
const create$
|
|
457
|
+
const create$8 = context => {
|
|
458
458
|
const sourceCode = getSourceCode(context);
|
|
459
459
|
if (!sourceCode.parserServices?.isYAML) {
|
|
460
460
|
return {};
|
|
@@ -482,11 +482,11 @@ const create$7 = context => {
|
|
|
482
482
|
|
|
483
483
|
const npm = {
|
|
484
484
|
__proto__: null,
|
|
485
|
-
create: create$
|
|
486
|
-
meta: meta$
|
|
485
|
+
create: create$8,
|
|
486
|
+
meta: meta$8
|
|
487
487
|
};
|
|
488
488
|
|
|
489
|
-
const meta$
|
|
489
|
+
const meta$7 = {
|
|
490
490
|
type: 'problem',
|
|
491
491
|
docs: {
|
|
492
492
|
description: 'Disallow unsupported on values'
|
|
@@ -495,7 +495,7 @@ const meta$6 = {
|
|
|
495
495
|
unsupportedOn: 'Unsupported on value: {{value}}'
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
|
-
const create$
|
|
498
|
+
const create$7 = context => {
|
|
499
499
|
const sourceCode = getSourceCode(context);
|
|
500
500
|
if (!sourceCode.parserServices?.isYAML) {
|
|
501
501
|
return {};
|
|
@@ -522,11 +522,11 @@ const create$6 = context => {
|
|
|
522
522
|
|
|
523
523
|
const on = {
|
|
524
524
|
__proto__: null,
|
|
525
|
-
create: create$
|
|
526
|
-
meta: meta$
|
|
525
|
+
create: create$7,
|
|
526
|
+
meta: meta$7
|
|
527
527
|
};
|
|
528
528
|
|
|
529
|
-
const meta$
|
|
529
|
+
const meta$6 = {
|
|
530
530
|
type: 'problem',
|
|
531
531
|
docs: {
|
|
532
532
|
description: 'Disallow unsupported permission values'
|
|
@@ -535,7 +535,7 @@ const meta$5 = {
|
|
|
535
535
|
unsupportedPermission: 'Unsupported permission value: {{value}}'
|
|
536
536
|
}
|
|
537
537
|
};
|
|
538
|
-
const create$
|
|
538
|
+
const create$6 = context => {
|
|
539
539
|
const sourceCode = getSourceCode(context);
|
|
540
540
|
if (!sourceCode.parserServices?.isYAML) {
|
|
541
541
|
return {};
|
|
@@ -577,11 +577,11 @@ const create$5 = context => {
|
|
|
577
577
|
|
|
578
578
|
const permissions = {
|
|
579
579
|
__proto__: null,
|
|
580
|
-
create: create$
|
|
581
|
-
meta: meta$
|
|
580
|
+
create: create$6,
|
|
581
|
+
meta: meta$6
|
|
582
582
|
};
|
|
583
583
|
|
|
584
|
-
const meta$
|
|
584
|
+
const meta$5 = {
|
|
585
585
|
type: 'problem',
|
|
586
586
|
docs: {
|
|
587
587
|
description: 'Disallow unsupported python versions'
|
|
@@ -590,7 +590,7 @@ const meta$4 = {
|
|
|
590
590
|
unsupportedPythonVersion: 'Unsupported python version: {{value}}'
|
|
591
591
|
}
|
|
592
592
|
};
|
|
593
|
-
const create$
|
|
593
|
+
const create$5 = context => {
|
|
594
594
|
const sourceCode = getSourceCode(context);
|
|
595
595
|
if (!sourceCode.parserServices?.isYAML) {
|
|
596
596
|
return {};
|
|
@@ -615,11 +615,11 @@ const create$4 = context => {
|
|
|
615
615
|
|
|
616
616
|
const pythonVersion = {
|
|
617
617
|
__proto__: null,
|
|
618
|
-
create: create$
|
|
619
|
-
meta: meta$
|
|
618
|
+
create: create$5,
|
|
619
|
+
meta: meta$5
|
|
620
620
|
};
|
|
621
621
|
|
|
622
|
-
const meta$
|
|
622
|
+
const meta$4 = {
|
|
623
623
|
type: 'problem',
|
|
624
624
|
docs: {
|
|
625
625
|
description: 'Disallow unsupported shell values'
|
|
@@ -628,7 +628,7 @@ const meta$3 = {
|
|
|
628
628
|
unsupportedShell: 'Unsupported shell value: {{value}}'
|
|
629
629
|
}
|
|
630
630
|
};
|
|
631
|
-
const create$
|
|
631
|
+
const create$4 = context => {
|
|
632
632
|
const sourceCode = getSourceCode(context);
|
|
633
633
|
if (!sourceCode.parserServices?.isYAML) {
|
|
634
634
|
return {};
|
|
@@ -653,11 +653,11 @@ const create$3 = context => {
|
|
|
653
653
|
|
|
654
654
|
const shell = {
|
|
655
655
|
__proto__: null,
|
|
656
|
-
create: create$
|
|
657
|
-
meta: meta$
|
|
656
|
+
create: create$4,
|
|
657
|
+
meta: meta$4
|
|
658
658
|
};
|
|
659
659
|
|
|
660
|
-
const meta$
|
|
660
|
+
const meta$3 = {
|
|
661
661
|
type: 'problem',
|
|
662
662
|
docs: {
|
|
663
663
|
description: 'Disallow unsupported timeout minute values'
|
|
@@ -666,7 +666,7 @@ const meta$2 = {
|
|
|
666
666
|
unsupportedTimeoutMinutes: 'Unsupported timeout minutes value: {{value}}'
|
|
667
667
|
}
|
|
668
668
|
};
|
|
669
|
-
const create$
|
|
669
|
+
const create$3 = context => {
|
|
670
670
|
const sourceCode = getSourceCode(context);
|
|
671
671
|
if (!sourceCode.parserServices?.isYAML) {
|
|
672
672
|
return {};
|
|
@@ -689,11 +689,11 @@ const create$2 = context => {
|
|
|
689
689
|
|
|
690
690
|
const timeoutMinutes = {
|
|
691
691
|
__proto__: null,
|
|
692
|
-
create: create$
|
|
693
|
-
meta: meta$
|
|
692
|
+
create: create$3,
|
|
693
|
+
meta: meta$3
|
|
694
694
|
};
|
|
695
695
|
|
|
696
|
-
const meta$
|
|
696
|
+
const meta$2 = {
|
|
697
697
|
type: 'problem',
|
|
698
698
|
docs: {
|
|
699
699
|
description: 'Disallow non-existing working directories'
|
|
@@ -712,7 +712,7 @@ const isAllowedNonExistingWorkingDirectory = relativePath => {
|
|
|
712
712
|
}
|
|
713
713
|
return false;
|
|
714
714
|
};
|
|
715
|
-
const create$
|
|
715
|
+
const create$2 = context => {
|
|
716
716
|
const sourceCode = getSourceCode(context);
|
|
717
717
|
if (!sourceCode.parserServices?.isYAML) {
|
|
718
718
|
return {};
|
|
@@ -749,11 +749,11 @@ const create$1 = context => {
|
|
|
749
749
|
|
|
750
750
|
const workingDirectory = {
|
|
751
751
|
__proto__: null,
|
|
752
|
-
create: create$
|
|
753
|
-
meta: meta$
|
|
752
|
+
create: create$2,
|
|
753
|
+
meta: meta$2
|
|
754
754
|
};
|
|
755
755
|
|
|
756
|
-
const meta = {
|
|
756
|
+
const meta$1 = {
|
|
757
757
|
type: 'problem',
|
|
758
758
|
docs: {
|
|
759
759
|
description: 'Disallow unsupported github token values'
|
|
@@ -762,7 +762,7 @@ const meta = {
|
|
|
762
762
|
unsupportedGithubToken: 'Unsupported github token value: {{value}}'
|
|
763
763
|
}
|
|
764
764
|
};
|
|
765
|
-
const create = context => {
|
|
765
|
+
const create$1 = context => {
|
|
766
766
|
const sourceCode = getSourceCode(context);
|
|
767
767
|
if (!sourceCode.parserServices?.isYAML) {
|
|
768
768
|
return {};
|
|
@@ -786,6 +786,56 @@ const create = context => {
|
|
|
786
786
|
};
|
|
787
787
|
|
|
788
788
|
const githubToken = {
|
|
789
|
+
__proto__: null,
|
|
790
|
+
create: create$1,
|
|
791
|
+
meta: meta$1
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
const meta = {
|
|
795
|
+
type: 'problem',
|
|
796
|
+
docs: {
|
|
797
|
+
description: 'Disallow unsupported release action usage'
|
|
798
|
+
},
|
|
799
|
+
messages: {
|
|
800
|
+
unsupportedReleaseAction: 'Unsupported release action'
|
|
801
|
+
},
|
|
802
|
+
fixable: 'code'
|
|
803
|
+
};
|
|
804
|
+
const create = context => {
|
|
805
|
+
const sourceCode = getSourceCode(context);
|
|
806
|
+
if (!sourceCode.parserServices?.isYAML) {
|
|
807
|
+
return {};
|
|
808
|
+
}
|
|
809
|
+
return {
|
|
810
|
+
YAMLPair(node) {
|
|
811
|
+
if (node && node.type === 'YAMLPair' && node.key && typeof node.key === 'object' && 'type' in node.key && node.key.type === 'YAMLScalar' && typeof node.key.value === 'string' && node.key.value === 'uses' && node.value && node.value.type === 'YAMLScalar' && node.value.value === 'actions/create-release@v1') {
|
|
812
|
+
context.report({
|
|
813
|
+
node,
|
|
814
|
+
messageId: 'unsupportedReleaseAction',
|
|
815
|
+
data: {},
|
|
816
|
+
fix(fixer) {
|
|
817
|
+
const edits = [];
|
|
818
|
+
const parent = node.parent;
|
|
819
|
+
edits.push(fixer.replaceText(node.value, 'softprops/action-gh-release@v2'));
|
|
820
|
+
for (const pair of parent.pairs) {
|
|
821
|
+
if (pair.key && pair.key.type === 'YAMLScalar' && pair.key.value === 'with' && pair.value?.type == 'YAMLMapping') {
|
|
822
|
+
const subPairs = pair.value.pairs;
|
|
823
|
+
for (const subPair of subPairs) {
|
|
824
|
+
if (subPair.key?.type === 'YAMLScalar' && subPair.key.value === 'release_name') {
|
|
825
|
+
edits.push(fixer.replaceText(subPair.key, 'name'));
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
return edits;
|
|
831
|
+
}
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
};
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
const releaseAction = {
|
|
789
839
|
__proto__: null,
|
|
790
840
|
create,
|
|
791
841
|
meta
|
|
@@ -805,6 +855,7 @@ const plugin = {
|
|
|
805
855
|
'node-version-file': nodeVersionFile,
|
|
806
856
|
'npm-registry': npmRegistry,
|
|
807
857
|
'python-version': pythonVersion,
|
|
858
|
+
'release-action': releaseAction,
|
|
808
859
|
'timeout-minutes': timeoutMinutes,
|
|
809
860
|
'working-directory': workingDirectory,
|
|
810
861
|
matrix: matrix,
|
|
@@ -837,6 +888,7 @@ const recommended = [{
|
|
|
837
888
|
'github-actions/on': 'error',
|
|
838
889
|
'github-actions/permissions': 'off',
|
|
839
890
|
'github-actions/python-version': 'error',
|
|
891
|
+
'github-actions/release-action': 'error',
|
|
840
892
|
'github-actions/shell': 'error',
|
|
841
893
|
'github-actions/timeout-minutes': 'error',
|
|
842
894
|
'github-actions/working-directory': 'error'
|