diff --git a/dist/index.js b/dist/index.js index 7d8932c..bd63ff1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -27526,7 +27526,7 @@ const normalize_options = function (opts) { ); } // Normalize option `columns` - options.cast_first_line_to_header = null; + options.cast_first_line_to_header = undefined; if (options.columns === true) { // Fields in the first line are converted as-is to columns options.cast_first_line_to_header = undefined; @@ -28954,10 +28954,14 @@ const transform = function (original_options = {}) { if (skip_records_with_error) { this.state.recordHasError = true; if (this.options.on_skip !== undefined) { - this.options.on_skip( - err, - raw ? this.state.rawBuffer.toString(encoding) : undefined, - ); + try { + this.options.on_skip( + err, + raw ? this.state.rawBuffer.toString(encoding) : undefined, + ); + } catch (err) { + return err; + } } // this.emit('skip', err, raw ? this.state.rawBuffer.toString(encoding) : undefined); return undefined; @@ -29011,10 +29015,13 @@ const parse = function (data, opts = {}) { } }; const close = () => {}; - const err1 = parser.parse(data, false, push, close); - if (err1 !== undefined) throw err1; - const err2 = parser.parse(undefined, true, push, close); - if (err2 !== undefined) throw err2; + const error = parser.parse(data, true, push, close); + if (error !== undefined) throw error; + // 250606: `parser.parse` was implemented as 2 calls: + // const err1 = parser.parse(data, false, push, close); + // if (err1 !== undefined) throw err1; + // const err2 = parser.parse(undefined, true, push, close); + // if (err2 !== undefined) throw err2; return records; }; diff --git a/package-lock.json b/package-lock.json index ee0eb8c..fde8b10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "@actions/core": "1.11.1", "@actions/exec": "1.1.1", "@actions/tool-cache": "2.0.2", - "csv-parse": "5.6.0", + "csv-parse": "6.0.0", "lodash": "4.17.21", "semver": "7.7.2" }, @@ -686,9 +686,9 @@ } }, "node_modules/csv-parse": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-5.6.0.tgz", - "integrity": "sha512-l3nz3euub2QMg5ouu5U09Ew9Wf6/wQ8I++ch1loQ0ljmzhmfZYrH9fflS22i/PQEvsPvxCwxgz5q7UB8K1JO4Q==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-6.0.0.tgz", + "integrity": "sha512-6aB9WrymEruVDwQOwa5AuYk4/Gb+HaJgLHGKOA9BXTqgsIFvbdHzQzZOuqNCOooTGciPDaHzTlGkU5P6kYVUYw==", "license": "MIT" }, "node_modules/debug": { diff --git a/package.json b/package.json index ffec98c..ba0b094 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@actions/core": "1.11.1", "@actions/exec": "1.1.1", "@actions/tool-cache": "2.0.2", - "csv-parse": "5.6.0", + "csv-parse": "6.0.0", "semver": "7.7.2", "lodash": "4.17.21" },