Skip to content

Commit 2731be8

Browse files
committed
feature: @putout/plugin-github: set-node-versions: exclude not array
1 parent 074ddb0 commit 2731be8

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
__putout_processor_yaml({
2+
"jobs": {
3+
"build": {
4+
"runs-on": "ubuntu-latest",
5+
"steps": {
6+
"uses": "actions/setup-node@v4",
7+
"with": {
8+
"node-version": "20"
9+
}
10+
}
11+
}
12+
}
13+
});

packages/plugin-github/lib/set-node-versions/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {isDeepStrictEqual} from 'node:util';
22
import {operator, template} from 'putout';
33

4+
const {isArray} = Array;
5+
46
const {
57
replaceWith,
68
getTemplateValues,
@@ -49,6 +51,9 @@ export const traverse = ({push, options}) => ({
4951
if (isDeepStrictEqual(versions, nodeVersions))
5052
continue;
5153

54+
if (!isArray(versions))
55+
continue;
56+
5257
for (const version of nodeVersions) {
5358
const [nodeVersion] = version.split('.');
5459

packages/plugin-github/lib/set-node-versions/index.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ test('plugin-github: set node versions: report: overlap', (t) => {
4242
t.end();
4343
});
4444

45+
test('plugin-github: set node versions: no report: no-matrix', (t) => {
46+
t.noReport('no-matrix');
47+
t.end();
48+
});
49+
4550
test('plugin-github: set node versions: no report with options: intersects', (t) => {
4651
t.noReportWithOptions('intersects', {
4752
versions: ['24.x'],

0 commit comments

Comments
 (0)