Skip to content

Commit 299f9ad

Browse files
committed
refactor: modernize
(cherry picked from commit c0bc1dc)
1 parent 7b2bf10 commit 299f9ad

2 files changed

Lines changed: 4 additions & 16 deletions

File tree

  • .github/actions

.github/actions/prepare-dynamic-steps/index.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
'use strict';
22

3-
process.on('unhandledRejection', (err) => {
4-
5-
throw err;
6-
});
7-
8-
93
const ActionsCore = require('@actions/core');
10-
const Fs = require('fs');
11-
const Path = require('path');
4+
const Fs = require('node:fs');
5+
const Path = require('node:path');
126
const Yaml = require('yaml');
137

148

.github/actions/prepare-node-test-matrix-action/index.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
'use strict';
22

3-
process.on('unhandledRejection', (err) => {
4-
5-
throw err;
6-
});
7-
8-
93
const ActionsCore = require('@actions/core');
10-
const Path = require('path');
4+
const Path = require('node:path');
115
const Schedule = require('./schedule.json'); // https://raw.githubusercontent.com/nodejs/Release/master/schedule.json
126
const Semver = require('semver');
137
const Yaml = require('yaml');
@@ -57,7 +51,7 @@ internals.normalizeRunsOn = function (runsOnInput) {
5751

5852
exports.main = function ({ now = new Date(), pkg = Package, debug = console.info } = {}) {
5953

60-
if (!pkg.engines || !pkg.engines.node) {
54+
if (!pkg?.engines?.node) {
6155
throw new Error('`engines.node` range not defined in `package.json`.');
6256
}
6357

0 commit comments

Comments
 (0)