From 9634409d1e7cbd424053c844e8c73d16cd325e34 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Wed, 30 Nov 2022 19:32:40 +0000 Subject: [PATCH 01/15] adding standard error --- dist/index.js | 4 ++-- src/git-command-manager.ts | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 47a99f1..911443c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4710,7 +4710,7 @@ module.exports = require("punycode"); /***/ 215: /***/ (function(module) { -module.exports = {"name":"@octokit/rest","version":"16.43.1","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/plugin-paginate-rest":"^1.1.1","@octokit/plugin-request-log":"^1.0.0","@octokit/plugin-rest-endpoint-methods":"2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^4.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","lolex":"^5.1.2","mkdirp":"^1.0.0","mocha":"^7.0.1","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^17.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}]}; +module.exports = {"_args":[["@octokit/rest@16.43.1","/workspaces/checkout"]],"_from":"@octokit/rest@16.43.1","_id":"@octokit/rest@16.43.1","_inBundle":false,"_integrity":"sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==","_location":"/@octokit/rest","_phantomChildren":{"@octokit/types":"2.14.0","deprecation":"2.3.1","once":"1.4.0"},"_requested":{"type":"version","registry":true,"raw":"@octokit/rest@16.43.1","name":"@octokit/rest","escapedName":"@octokit%2frest","scope":"@octokit","rawSpec":"16.43.1","saveSpec":null,"fetchSpec":"16.43.1"},"_requiredBy":["/@actions/github"],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz","_spec":"16.43.1","_where":"/workspaces/checkout","author":{"name":"Gregor Martynus","url":"https://github.com/gr2m"},"bugs":{"url":"https://github.com/octokit/rest.js/issues"},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/plugin-paginate-rest":"^1.1.1","@octokit/plugin-request-log":"^1.0.0","@octokit/plugin-rest-endpoint-methods":"2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"description":"GitHub REST API client for Node.js","devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^4.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","lolex":"^5.1.2","mkdirp":"^1.0.0","mocha":"^7.0.1","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^17.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"files":["index.js","index.d.ts","lib","plugins"],"homepage":"https://github.com/octokit/rest.js#readme","keywords":["octokit","github","rest","api-client"],"license":"MIT","name":"@octokit/rest","nyc":{"ignore":["test"]},"publishConfig":{"access":"public"},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"repository":{"type":"git","url":"git+https://github.com/octokit/rest.js.git"},"scripts":{"build":"npm-run-all build:*","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","build:ts":"npm run -s update-endpoints:typescript","coverage":"nyc report --reporter=html && open coverage/index.html","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","prebuild:browser":"mkdirp dist/","pretest":"npm run -s lint","prevalidate:ts":"npm run -s build:ts","start-fixtures-server":"octokit-fixtures-server","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:typescript":"node scripts/update-endpoints/typescript","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts"},"types":"index.d.ts","version":"16.43.1"}; /***/ }), @@ -7399,7 +7399,7 @@ class GitCommandManager { else { args.push('--branches'); } - const output = yield this.execGit(args); + const output = yield this.execGit(args, false, true); for (let branch of output.stdout.trim().split('\n')) { branch = branch.trim(); if (branch) { diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 699a963..37a99a0 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -104,7 +104,7 @@ class GitCommandManager { args.push('--branches') } - const output = await this.execGit(args) + const output = await this.execGit(args, false, true) for (let branch of output.stdout.trim().split('\n')) { branch = branch.trim() @@ -409,7 +409,7 @@ class GitCommandManager { env[key] = this.gitEnv[key] } - const stdout: string[] = [] + const stdout: string[] = ['ardvark'] const options = { cwd: this.workingDirectory, @@ -419,6 +419,9 @@ class GitCommandManager { listeners: { stdout: (data: Buffer) => { stdout.push(data.toString()) + }, + stderr: (data: Buffer) => { + stdout.push(data.toString()) } } } From 2c24b08d98101f81c4366cd651549544fbda5402 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Wed, 30 Nov 2022 19:40:09 +0000 Subject: [PATCH 02/15] removing silent option --- src/git-command-manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 37a99a0..512377d 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -104,7 +104,7 @@ class GitCommandManager { args.push('--branches') } - const output = await this.execGit(args, false, true) + const output = await this.execGit(args) for (let branch of output.stdout.trim().split('\n')) { branch = branch.trim() From ad19603e6b3bde71952b6af728907f6adf9531af Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Wed, 30 Nov 2022 19:42:26 +0000 Subject: [PATCH 03/15] removing silent option --- dist/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 911443c..0e1b3fb 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7399,7 +7399,7 @@ class GitCommandManager { else { args.push('--branches'); } - const output = yield this.execGit(args, false, true); + const output = yield this.execGit(args); for (let branch of output.stdout.trim().split('\n')) { branch = branch.trim(); if (branch) { @@ -7672,7 +7672,7 @@ class GitCommandManager { for (const key of Object.keys(this.gitEnv)) { env[key] = this.gitEnv[key]; } - const stdout = []; + const stdout = ['ardvark']; const options = { cwd: this.workingDirectory, env, @@ -7681,6 +7681,9 @@ class GitCommandManager { listeners: { stdout: (data) => { stdout.push(data.toString()); + }, + stderr: (data) => { + stdout.push(data.toString()); } } }; From 5788ebd085476c4875a9d5471b7f4817725ceedd Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Wed, 30 Nov 2022 20:03:42 +0000 Subject: [PATCH 04/15] adding listener --- dist/index.js | 29 ++++++++++++++++++----------- src/git-command-manager.ts | 32 +++++++++++++++++++------------- 2 files changed, 37 insertions(+), 24 deletions(-) diff --git a/dist/index.js b/dist/index.js index 0e1b3fb..c675ba5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7399,7 +7399,12 @@ class GitCommandManager { else { args.push('--branches'); } - const output = yield this.execGit(args); + const listeners = { + stderr: (data) => { + core.debug(data.toString()); + } + }; + const output = yield this.execGit(args, false, false, listeners); for (let branch of output.stdout.trim().split('\n')) { branch = branch.trim(); if (branch) { @@ -7661,7 +7666,7 @@ class GitCommandManager { return result; }); } - execGit(args, allowAllExitCodes = false, silent = false) { + execGit(args, allowAllExitCodes = false, silent = false, customListeners = {}) { return __awaiter(this, void 0, void 0, function* () { fshelper.directoryExistsSync(this.workingDirectory, true); const result = new GitOutput(); @@ -7672,20 +7677,22 @@ class GitCommandManager { for (const key of Object.keys(this.gitEnv)) { env[key] = this.gitEnv[key]; } - const stdout = ['ardvark']; + const defaultListener = { + stdout: (data) => { + stdout.push(data.toString()); + } + }; + // const listeners = Object.keys(customListeners) < 0 ? customListeners : {stdout: (data: Buffer) => { + // stdout.push(data.toString()) + // }} + const listenersD = Object.assign(Object.assign({}, customListeners), defaultListener); + const stdout = []; const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: { - stdout: (data) => { - stdout.push(data.toString()); - }, - stderr: (data) => { - stdout.push(data.toString()); - } - } + listeners: listenersD }; result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options); result.stdout = stdout.join(''); diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 512377d..d150d0f 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -104,7 +104,12 @@ class GitCommandManager { args.push('--branches') } - const output = await this.execGit(args) + const listeners = { + stderr: (data: Buffer) => { + core.debug(data.toString()) + } + } + const output = await this.execGit(args, false, false, listeners) for (let branch of output.stdout.trim().split('\n')) { branch = branch.trim() @@ -395,7 +400,8 @@ class GitCommandManager { private async execGit( args: string[], allowAllExitCodes = false, - silent = false + silent = false, + customListeners = {} ): Promise { fshelper.directoryExistsSync(this.workingDirectory, true) @@ -408,22 +414,22 @@ class GitCommandManager { for (const key of Object.keys(this.gitEnv)) { env[key] = this.gitEnv[key] } - - const stdout: string[] = ['ardvark'] - + const defaultListener = { + stdout: (data: Buffer) => { + stdout.push(data.toString()) + } + } + // const listeners = Object.keys(customListeners) < 0 ? customListeners : {stdout: (data: Buffer) => { + // stdout.push(data.toString()) + // }} + const listenersD = {...customListeners, ...defaultListener} + const stdout: string[] = [] const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: { - stdout: (data: Buffer) => { - stdout.push(data.toString()) - }, - stderr: (data: Buffer) => { - stdout.push(data.toString()) - } - } + listeners: listenersD } result.exitCode = await exec.exec(`"${this.gitPath}"`, args, options) From 9684017cd699538427966653a79db20f982c30ec Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Wed, 30 Nov 2022 20:35:36 +0000 Subject: [PATCH 05/15] adding stderr --- dist/index.js | 4 +++- src/git-command-manager.ts | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index c675ba5..307d9fd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7388,6 +7388,7 @@ class GitCommandManager { branchList(remote) { return __awaiter(this, void 0, void 0, function* () { const result = []; + const stderr = []; // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from // "branch --list" is more difficult when in a detached HEAD state. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug @@ -7401,7 +7402,7 @@ class GitCommandManager { } const listeners = { stderr: (data) => { - core.debug(data.toString()); + stderr.push(data.toString()); } }; const output = yield this.execGit(args, false, false, listeners); @@ -7417,6 +7418,7 @@ class GitCommandManager { result.push(branch); } } + core.debug(stderr.join('\n')); return result; }); } diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index d150d0f..afcb285 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -91,6 +91,7 @@ class GitCommandManager { async branchList(remote: boolean): Promise { const result: string[] = [] + const stderr: string[] = [] // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from // "branch --list" is more difficult when in a detached HEAD state. @@ -106,7 +107,7 @@ class GitCommandManager { const listeners = { stderr: (data: Buffer) => { - core.debug(data.toString()) + stderr.push(data.toString()) } } const output = await this.execGit(args, false, false, listeners) @@ -123,7 +124,7 @@ class GitCommandManager { result.push(branch) } } - + core.debug(stderr.join('\n')) return result } From f1764260c3a3fe63e406baecf0cee7f558c9e433 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Wed, 30 Nov 2022 20:41:41 +0000 Subject: [PATCH 06/15] adding stderr --- dist/index.js | 3 +++ src/git-command-manager.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/dist/index.js b/dist/index.js index 307d9fd..cbd67f0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7403,6 +7403,9 @@ class GitCommandManager { const listeners = { stderr: (data) => { stderr.push(data.toString()); + }, + errline: (line) => { + stderr.push(line); } }; const output = yield this.execGit(args, false, false, listeners); diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index afcb285..39075a7 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -108,6 +108,9 @@ class GitCommandManager { const listeners = { stderr: (data: Buffer) => { stderr.push(data.toString()) + }, + errline: (line: string) => { + stderr.push(line) } } const output = await this.execGit(args, false, false, listeners) From 9679ac6b686c701fa8c1050e57fd9ee7097009ad Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Wed, 30 Nov 2022 20:42:30 +0000 Subject: [PATCH 07/15] adding stderr --- src/git-command-manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 39075a7..95004f2 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -127,7 +127,7 @@ class GitCommandManager { result.push(branch) } } - core.debug(stderr.join('\n')) + core.info(stderr.join('\n')) return result } From 1f9aeb9f74defe2baa514759308d8de8b14f1f12 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Wed, 30 Nov 2022 20:45:33 +0000 Subject: [PATCH 08/15] adding stderr --- dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index cbd67f0..6a5dea2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7421,7 +7421,7 @@ class GitCommandManager { result.push(branch); } } - core.debug(stderr.join('\n')); + core.info(stderr.join('\n')); return result; }); } From bac1bcfa81e7990871a7b944594f6a3832c36fc3 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 15:20:32 +0000 Subject: [PATCH 09/15] . --- dist/index.js | 14 +++++++++++++- package-lock.json | 13 +++++++++++++ package.json | 1 + src/git-command-manager.ts | 11 ++++++++++- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 6a5dea2..f8fc0c4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7333,6 +7333,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); exports.createCommandManager = exports.MinimumGitVersion = void 0; const core = __importStar(__webpack_require__(470)); @@ -7344,6 +7347,7 @@ const refHelper = __importStar(__webpack_require__(227)); const regexpHelper = __importStar(__webpack_require__(528)); const retryHelper = __importStar(__webpack_require__(587)); const git_version_1 = __webpack_require__(559); +const stream_1 = __importDefault(__webpack_require__(794)); // Auth header not supported before 2.9 // Wire protocol v2 not supported before 2.18 exports.MinimumGitVersion = new git_version_1.GitVersion('2.18'); @@ -7692,15 +7696,23 @@ class GitCommandManager { // }} const listenersD = Object.assign(Object.assign({}, customListeners), defaultListener); const stdout = []; + let temp = ''; const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD + listeners: listenersD, + errStream: new stream_1.default.Writable({ + write(chunk, _, next) { + temp += chunk.toString(); + next(); + } + }) }; result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options); result.stdout = stdout.join(''); + core.info(temp.length.toString()); return result; }); } diff --git a/package-lock.json b/package-lock.json index 2870934..4022862 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5906,6 +5906,11 @@ "integrity": "sha512-qcLvDUPf8DSIMWarHT2ptgcqrYg62n3vPA7vhrOF24d8UNzbUBaHu2CySiENR3nEDzYgaN60071t0F6KLYMQ7Q==", "dev": true }, + "emitter-component": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/emitter-component/-/emitter-component-1.1.1.tgz", + "integrity": "sha512-G+mpdiAySMuB7kesVRLuyvYRqDmshB7ReKEVuyBPkzQlmiDiLrt7hHHIy4Aff552bgknVN7B2/d3lzhGO5dvpQ==" + }, "emittery": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", @@ -16487,6 +16492,14 @@ } } }, + "stream": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stream/-/stream-0.0.2.tgz", + "integrity": "sha512-gCq3NDI2P35B2n6t76YJuOp7d6cN/C7Rt0577l91wllh0sY9ZBuw9KaSGqH/b0hzn3CWWJbpbW0W0WvQ1H/Q7g==", + "requires": { + "emitter-component": "^1.1.1" + } + }, "string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", diff --git a/package.json b/package.json index d305679..316aefe 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@actions/github": "^2.2.0", "@actions/io": "^1.0.1", "@actions/tool-cache": "^1.1.2", + "stream": "0.0.2", "uuid": "^3.3.3" }, "devDependencies": { diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 95004f2..2cac95d 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -7,6 +7,7 @@ import * as refHelper from './ref-helper' import * as regexpHelper from './regexp-helper' import * as retryHelper from './retry-helper' import {GitVersion} from './git-version' +import stream, {Writable} from 'stream' // Auth header not supported before 2.9 // Wire protocol v2 not supported before 2.18 @@ -428,16 +429,24 @@ class GitCommandManager { // }} const listenersD = {...customListeners, ...defaultListener} const stdout: string[] = [] + let temp = '' const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD + listeners: listenersD, + errStream: new stream.Writable({ + write(chunk, _, next) { + temp += chunk.toString() + next() + } + }) } result.exitCode = await exec.exec(`"${this.gitPath}"`, args, options) result.stdout = stdout.join('') + core.info(temp.length.toString()) return result } From 25424e8595832e5920397a67f42204c13dbd97f8 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 15:41:55 +0000 Subject: [PATCH 10/15] . --- src/git-command-manager.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 2cac95d..0fc0aed 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -430,6 +430,7 @@ class GitCommandManager { const listenersD = {...customListeners, ...defaultListener} const stdout: string[] = [] let temp = '' + let temp2 = '' const options = { cwd: this.workingDirectory, env, @@ -441,12 +442,20 @@ class GitCommandManager { temp += chunk.toString() next() } + }), + + outStream: new stream.Writable({ + write(chunk, _, next) { + temp2 += chunk.toString() + next() + } }) } result.exitCode = await exec.exec(`"${this.gitPath}"`, args, options) result.stdout = stdout.join('') core.info(temp.length.toString()) + core.info(temp2.length.toString()) return result } From d2e9d8b595dda75742c2a742ff92f7f4bce64db9 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 15:42:14 +0000 Subject: [PATCH 11/15] . --- dist/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dist/index.js b/dist/index.js index f8fc0c4..4945647 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7697,6 +7697,7 @@ class GitCommandManager { const listenersD = Object.assign(Object.assign({}, customListeners), defaultListener); const stdout = []; let temp = ''; + let temp2 = ''; const options = { cwd: this.workingDirectory, env, @@ -7708,11 +7709,18 @@ class GitCommandManager { temp += chunk.toString(); next(); } + }), + outStream: new stream_1.default.Writable({ + write(chunk, _, next) { + temp2 += chunk.toString(); + next(); + } }) }; result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options); result.stdout = stdout.join(''); core.info(temp.length.toString()); + core.info(temp2.length.toString()); return result; }); } From a9f581070eeb8e1555eb74772a0ccd21980b24a2 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 15:45:10 +0000 Subject: [PATCH 12/15] . --- dist/index.js | 31 ++++++++++--------------------- src/git-command-manager.ts | 28 ++++++++++------------------ 2 files changed, 20 insertions(+), 39 deletions(-) diff --git a/dist/index.js b/dist/index.js index 4945647..f7b14bc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7333,9 +7333,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", { value: true }); exports.createCommandManager = exports.MinimumGitVersion = void 0; const core = __importStar(__webpack_require__(470)); @@ -7347,7 +7344,6 @@ const refHelper = __importStar(__webpack_require__(227)); const regexpHelper = __importStar(__webpack_require__(528)); const retryHelper = __importStar(__webpack_require__(587)); const git_version_1 = __webpack_require__(559); -const stream_1 = __importDefault(__webpack_require__(794)); // Auth header not supported before 2.9 // Wire protocol v2 not supported before 2.18 exports.MinimumGitVersion = new git_version_1.GitVersion('2.18'); @@ -7696,31 +7692,24 @@ class GitCommandManager { // }} const listenersD = Object.assign(Object.assign({}, customListeners), defaultListener); const stdout = []; - let temp = ''; - let temp2 = ''; + // let temp = '' const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD, - errStream: new stream_1.default.Writable({ - write(chunk, _, next) { - temp += chunk.toString(); - next(); - } - }), - outStream: new stream_1.default.Writable({ - write(chunk, _, next) { - temp2 += chunk.toString(); - next(); - } - }) + listeners: listenersD + // , + // errStream: new stream.Writable({ + // write(chunk, _, next) { + // temp += chunk.toString() + // next() + // } + // }) }; result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options); result.stdout = stdout.join(''); - core.info(temp.length.toString()); - core.info(temp2.length.toString()); + core.info(result.stdout); return result; }); } diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 0fc0aed..2a0b588 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -429,33 +429,25 @@ class GitCommandManager { // }} const listenersD = {...customListeners, ...defaultListener} const stdout: string[] = [] - let temp = '' - let temp2 = '' + // let temp = '' const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD, - errStream: new stream.Writable({ - write(chunk, _, next) { - temp += chunk.toString() - next() - } - }), - - outStream: new stream.Writable({ - write(chunk, _, next) { - temp2 += chunk.toString() - next() - } - }) + listeners: listenersD + // , + // errStream: new stream.Writable({ + // write(chunk, _, next) { + // temp += chunk.toString() + // next() + // } + // }) } result.exitCode = await exec.exec(`"${this.gitPath}"`, args, options) result.stdout = stdout.join('') - core.info(temp.length.toString()) - core.info(temp2.length.toString()) + core.info(result.stdout) return result } From b99f9d0abab65214fe4f1812f7d2cd23f281460e Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 15:52:47 +0000 Subject: [PATCH 13/15] . --- dist/index.js | 1 + src/git-command-manager.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/dist/index.js b/dist/index.js index f7b14bc..54cd2c4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7389,6 +7389,7 @@ class GitCommandManager { return __awaiter(this, void 0, void 0, function* () { const result = []; const stderr = []; + core.info(this.gitEnv['GIT_HTTP_USER_AGENT']); // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from // "branch --list" is more difficult when in a detached HEAD state. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 2a0b588..4c86e65 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -94,6 +94,7 @@ class GitCommandManager { const result: string[] = [] const stderr: string[] = [] + core.info(this.gitEnv['GIT_HTTP_USER_AGENT']) // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from // "branch --list" is more difficult when in a detached HEAD state. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug From 8e555ec39e30b1ef6df1fc9e1a628b867115deba Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 15:56:41 +0000 Subject: [PATCH 14/15] . --- dist/index.js | 32 +++++++++++++++++++++----------- src/git-command-manager.ts | 29 ++++++++++++++++++----------- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/dist/index.js b/dist/index.js index 54cd2c4..4945647 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7333,6 +7333,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); exports.createCommandManager = exports.MinimumGitVersion = void 0; const core = __importStar(__webpack_require__(470)); @@ -7344,6 +7347,7 @@ const refHelper = __importStar(__webpack_require__(227)); const regexpHelper = __importStar(__webpack_require__(528)); const retryHelper = __importStar(__webpack_require__(587)); const git_version_1 = __webpack_require__(559); +const stream_1 = __importDefault(__webpack_require__(794)); // Auth header not supported before 2.9 // Wire protocol v2 not supported before 2.18 exports.MinimumGitVersion = new git_version_1.GitVersion('2.18'); @@ -7389,7 +7393,6 @@ class GitCommandManager { return __awaiter(this, void 0, void 0, function* () { const result = []; const stderr = []; - core.info(this.gitEnv['GIT_HTTP_USER_AGENT']); // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from // "branch --list" is more difficult when in a detached HEAD state. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug @@ -7693,24 +7696,31 @@ class GitCommandManager { // }} const listenersD = Object.assign(Object.assign({}, customListeners), defaultListener); const stdout = []; - // let temp = '' + let temp = ''; + let temp2 = ''; const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD - // , - // errStream: new stream.Writable({ - // write(chunk, _, next) { - // temp += chunk.toString() - // next() - // } - // }) + listeners: listenersD, + errStream: new stream_1.default.Writable({ + write(chunk, _, next) { + temp += chunk.toString(); + next(); + } + }), + outStream: new stream_1.default.Writable({ + write(chunk, _, next) { + temp2 += chunk.toString(); + next(); + } + }) }; result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options); result.stdout = stdout.join(''); - core.info(result.stdout); + core.info(temp.length.toString()); + core.info(temp2.length.toString()); return result; }); } diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 4c86e65..0fc0aed 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -94,7 +94,6 @@ class GitCommandManager { const result: string[] = [] const stderr: string[] = [] - core.info(this.gitEnv['GIT_HTTP_USER_AGENT']) // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from // "branch --list" is more difficult when in a detached HEAD state. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug @@ -430,25 +429,33 @@ class GitCommandManager { // }} const listenersD = {...customListeners, ...defaultListener} const stdout: string[] = [] - // let temp = '' + let temp = '' + let temp2 = '' const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD - // , - // errStream: new stream.Writable({ - // write(chunk, _, next) { - // temp += chunk.toString() - // next() - // } - // }) + listeners: listenersD, + errStream: new stream.Writable({ + write(chunk, _, next) { + temp += chunk.toString() + next() + } + }), + + outStream: new stream.Writable({ + write(chunk, _, next) { + temp2 += chunk.toString() + next() + } + }) } result.exitCode = await exec.exec(`"${this.gitPath}"`, args, options) result.stdout = stdout.join('') - core.info(result.stdout) + core.info(temp.length.toString()) + core.info(temp2.length.toString()) return result } From af5130cb8882054eda385840657dcbd1e19ab8f4 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 18:37:34 +0000 Subject: [PATCH 15/15] . --- dist/index.js | 40 ++++++++++++++++++-------------------- src/git-command-manager.ts | 36 ++++++++++++++++++---------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/dist/index.js b/dist/index.js index 4945647..9c56430 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7333,9 +7333,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", { value: true }); exports.createCommandManager = exports.MinimumGitVersion = void 0; const core = __importStar(__webpack_require__(470)); @@ -7347,7 +7344,6 @@ const refHelper = __importStar(__webpack_require__(227)); const regexpHelper = __importStar(__webpack_require__(528)); const retryHelper = __importStar(__webpack_require__(587)); const git_version_1 = __webpack_require__(559); -const stream_1 = __importDefault(__webpack_require__(794)); // Auth header not supported before 2.9 // Wire protocol v2 not supported before 2.18 exports.MinimumGitVersion = new git_version_1.GitVersion('2.18'); @@ -7696,31 +7692,33 @@ class GitCommandManager { // }} const listenersD = Object.assign(Object.assign({}, customListeners), defaultListener); const stdout = []; - let temp = ''; - let temp2 = ''; + // let temp = '' + // let temp2 = '' const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD, - errStream: new stream_1.default.Writable({ - write(chunk, _, next) { - temp += chunk.toString(); - next(); - } - }), - outStream: new stream_1.default.Writable({ - write(chunk, _, next) { - temp2 += chunk.toString(); - next(); - } - }) + listeners: listenersD + // , + // errStream: new stream.Writable({ + // write(chunk, _, next) { + // temp += chunk.toString() + // next() + // } + // }), + // outStream: new stream.Writable({ + // write(chunk, _, next) { + // temp2 += chunk.toString() + // next() + // } + // }) }; result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options); result.stdout = stdout.join(''); - core.info(temp.length.toString()); - core.info(temp2.length.toString()); + // core.info(temp.length.toString()) + // core.info(temp2.length.toString()) + core.info(result.stdout); return result; }); } diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 0fc0aed..2c67ef5 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -429,33 +429,35 @@ class GitCommandManager { // }} const listenersD = {...customListeners, ...defaultListener} const stdout: string[] = [] - let temp = '' - let temp2 = '' + // let temp = '' + // let temp2 = '' const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD, - errStream: new stream.Writable({ - write(chunk, _, next) { - temp += chunk.toString() - next() - } - }), + listeners: listenersD + // , + // errStream: new stream.Writable({ + // write(chunk, _, next) { + // temp += chunk.toString() + // next() + // } + // }), - outStream: new stream.Writable({ - write(chunk, _, next) { - temp2 += chunk.toString() - next() - } - }) + // outStream: new stream.Writable({ + // write(chunk, _, next) { + // temp2 += chunk.toString() + // next() + // } + // }) } result.exitCode = await exec.exec(`"${this.gitPath}"`, args, options) result.stdout = stdout.join('') - core.info(temp.length.toString()) - core.info(temp2.length.toString()) + // core.info(temp.length.toString()) + // core.info(temp2.length.toString()) + core.info(result.stdout) return result }