@lvce-editor/eslint-plugin-github-actions 2.3.0 → 2.4.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.
Files changed (2) hide show
  1. package/dist/index.js +50 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14,13 +14,17 @@ const platforms = {
14
14
  const actions = {
15
15
  'actions/checkout': ['actions/checkout@v4'],
16
16
  'actions/setup-node': ['actions/setup-node@v6'],
17
- 'actions/cache': ['actions/cache@v4']
17
+ 'actions/cache': ['actions/cache@v4'],
18
+ 'actions/upload-pages-artifact': ['actions/upload-pages-artifact@v4'],
19
+ 'actions/deploy-pages': ['actions/deploy-pages@v4'],
20
+ 'actions/download-artifact': ['actions/download-artifact@v4'],
21
+ 'actions/upload-artifact': ['actions/upload-artifact@v4']
18
22
  };
19
23
 
20
24
  const isSupported = (actions, value) => {
21
25
  return actions.includes(value);
22
26
  };
23
- const meta$1 = {
27
+ const meta$2 = {
24
28
  type: 'problem',
25
29
  docs: {
26
30
  description: 'Disallow unsupported action versions'
@@ -29,7 +33,7 @@ const meta$1 = {
29
33
  unsupportedActionVersion: 'Unsupported action version: {{value}}'
30
34
  }
31
35
  };
32
- const create$1 = context => {
36
+ const create$2 = context => {
33
37
  const sourceCode = getSourceCode(context);
34
38
  if (!sourceCode.parserServices?.isYAML) {
35
39
  return {};
@@ -56,11 +60,11 @@ const create$1 = context => {
56
60
 
57
61
  const actionVersions = {
58
62
  __proto__: null,
59
- create: create$1,
60
- meta: meta$1
63
+ create: create$2,
64
+ meta: meta$2
61
65
  };
62
66
 
63
- const parseVersion = (value, prefix) => {
67
+ const parseVersion = value => {
64
68
  return value;
65
69
  };
66
70
  const parseUbuntuVersion = value => {
@@ -81,7 +85,7 @@ const isSupportedMacosversion = version => {
81
85
  const isSupportedWindowsVersion = version => {
82
86
  return config.windows.includes(version);
83
87
  };
84
- const meta = {
88
+ const meta$1 = {
85
89
  type: 'problem',
86
90
  docs: {
87
91
  description: 'Disallow unsupported ci versions'
@@ -90,7 +94,7 @@ const meta = {
90
94
  unsupportedCiVersion: 'Unsupported ci version: {{value}}'
91
95
  }
92
96
  };
93
- const create = context => {
97
+ const create$1 = context => {
94
98
  const sourceCode = getSourceCode(context);
95
99
  if (!sourceCode.parserServices?.isYAML) {
96
100
  return {};
@@ -132,6 +136,42 @@ const create = context => {
132
136
  };
133
137
 
134
138
  const ciVersions = {
139
+ __proto__: null,
140
+ create: create$1,
141
+ meta: meta$1
142
+ };
143
+
144
+ const meta = {
145
+ type: 'problem',
146
+ docs: {
147
+ description: 'Disallow unsupported timeout minute values'
148
+ },
149
+ messages: {
150
+ unsupportedTimeoutMinutes: 'Unsupported timeout minutes value: {{value}}'
151
+ }
152
+ };
153
+ const create = context => {
154
+ const sourceCode = getSourceCode(context);
155
+ if (!sourceCode.parserServices?.isYAML) {
156
+ return {};
157
+ }
158
+ return {
159
+ YAMLPair(node) {
160
+ 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 === 'timeout-minutes' && node.value && typeof node.value === 'object' && 'type' in node.value && node.value.type === 'YAMLScalar' && typeof node.value.value !== 'number') {
161
+ const nodeValue = node.value.value;
162
+ context.report({
163
+ node,
164
+ messageId: 'unsupportedTimeoutMinutes',
165
+ data: {
166
+ value: nodeValue
167
+ }
168
+ });
169
+ }
170
+ }
171
+ };
172
+ };
173
+
174
+ const timeoutMinutes = {
135
175
  __proto__: null,
136
176
  create,
137
177
  meta
@@ -144,7 +184,8 @@ const plugin = {
144
184
  },
145
185
  rules: {
146
186
  'ci-versions': ciVersions,
147
- 'action-versions': actionVersions
187
+ 'action-versions': actionVersions,
188
+ 'timeout-minutes': timeoutMinutes
148
189
  }
149
190
  };
150
191
  const recommended = [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/eslint-plugin-github-actions",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "keywords": [],