Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 36 additions & 32 deletions action/dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17600,12 +17600,12 @@ var require_lib = __commonJS({
throw new Error("Client has already been disposed.");
}
const parsedUrl = new URL(requestUrl);
let info3 = this._prepareRequest(verb, parsedUrl, headers);
let info4 = this._prepareRequest(verb, parsedUrl, headers);
const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1;
let numTries = 0;
let response;
do {
response = yield this.requestRaw(info3, data);
response = yield this.requestRaw(info4, data);
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
let authenticationHandler;
for (const handler2 of this.handlers) {
Expand All @@ -17615,7 +17615,7 @@ var require_lib = __commonJS({
}
}
if (authenticationHandler) {
return authenticationHandler.handleAuthentication(this, info3, data);
return authenticationHandler.handleAuthentication(this, info4, data);
} else {
return response;
}
Expand All @@ -17638,8 +17638,8 @@ var require_lib = __commonJS({
}
}
}
info3 = this._prepareRequest(verb, parsedRedirectUrl, headers);
response = yield this.requestRaw(info3, data);
info4 = this._prepareRequest(verb, parsedRedirectUrl, headers);
response = yield this.requestRaw(info4, data);
redirectsRemaining--;
}
if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) {
Expand Down Expand Up @@ -17668,7 +17668,7 @@ var require_lib = __commonJS({
* @param info
* @param data
*/
requestRaw(info3, data) {
requestRaw(info4, data) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
function callbackForResult(err, res) {
Expand All @@ -17680,7 +17680,7 @@ var require_lib = __commonJS({
resolve(res);
}
}
this.requestRawWithCallback(info3, data, callbackForResult);
this.requestRawWithCallback(info4, data, callbackForResult);
});
});
}
Expand All @@ -17690,12 +17690,12 @@ var require_lib = __commonJS({
* @param data
* @param onResult
*/
requestRawWithCallback(info3, data, onResult) {
requestRawWithCallback(info4, data, onResult) {
if (typeof data === "string") {
if (!info3.options.headers) {
info3.options.headers = {};
if (!info4.options.headers) {
info4.options.headers = {};
}
info3.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
info4.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
}
let callbackCalled = false;
function handleResult(err, res) {
Expand All @@ -17704,7 +17704,7 @@ var require_lib = __commonJS({
onResult(err, res);
}
}
const req = info3.httpModule.request(info3.options, (msg) => {
const req = info4.httpModule.request(info4.options, (msg) => {
const res = new HttpClientResponse(msg);
handleResult(void 0, res);
});
Expand All @@ -17716,7 +17716,7 @@ var require_lib = __commonJS({
if (socket) {
socket.end();
}
handleResult(new Error(`Request timeout: ${info3.options.path}`));
handleResult(new Error(`Request timeout: ${info4.options.path}`));
});
req.on("error", function(err) {
handleResult(err);
Expand Down Expand Up @@ -17752,27 +17752,27 @@ var require_lib = __commonJS({
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
}
_prepareRequest(method, requestUrl, headers) {
const info3 = {};
info3.parsedUrl = requestUrl;
const usingSsl = info3.parsedUrl.protocol === "https:";
info3.httpModule = usingSsl ? https : http;
const info4 = {};
info4.parsedUrl = requestUrl;
const usingSsl = info4.parsedUrl.protocol === "https:";
info4.httpModule = usingSsl ? https : http;
const defaultPort = usingSsl ? 443 : 80;
info3.options = {};
info3.options.host = info3.parsedUrl.hostname;
info3.options.port = info3.parsedUrl.port ? parseInt(info3.parsedUrl.port) : defaultPort;
info3.options.path = (info3.parsedUrl.pathname || "") + (info3.parsedUrl.search || "");
info3.options.method = method;
info3.options.headers = this._mergeHeaders(headers);
info4.options = {};
info4.options.host = info4.parsedUrl.hostname;
info4.options.port = info4.parsedUrl.port ? parseInt(info4.parsedUrl.port) : defaultPort;
info4.options.path = (info4.parsedUrl.pathname || "") + (info4.parsedUrl.search || "");
info4.options.method = method;
info4.options.headers = this._mergeHeaders(headers);
if (this.userAgent != null) {
info3.options.headers["user-agent"] = this.userAgent;
info4.options.headers["user-agent"] = this.userAgent;
}
info3.options.agent = this._getAgent(info3.parsedUrl);
info4.options.agent = this._getAgent(info4.parsedUrl);
if (this.handlers) {
for (const handler2 of this.handlers) {
handler2.prepareRequest(info3.options);
handler2.prepareRequest(info4.options);
}
}
return info3;
return info4;
}
_mergeHeaders(headers) {
if (this.requestOptions && this.requestOptions.headers) {
Expand Down Expand Up @@ -19762,10 +19762,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
(0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
}
exports2.notice = notice;
function info3(message) {
function info4(message) {
process.stdout.write(message + os.EOL);
}
exports2.info = info3;
exports2.info = info4;
function startGroup(name) {
(0, command_1.issue)("group", name);
}
Expand Down Expand Up @@ -21708,9 +21708,9 @@ var require_debuggability = __commonJS({
}
shouldIgnore = function(line) {
if (bluebirdFramePattern.test(line)) return true;
var info3 = parseLineInfo(line);
if (info3) {
if (info3.fileName === firstFileName && (firstIndex <= info3.line && info3.line <= lastIndex)) {
var info4 = parseLineInfo(line);
if (info4) {
if (info4.fileName === firstFileName && (firstIndex <= info4.line && info4.line <= lastIndex)) {
return true;
}
}
Expand Down Expand Up @@ -36656,6 +36656,10 @@ ${comparadiseCommentDetails}` : comparadiseBaseComment;
...import_github3.context.repo
});
const prNumber = data.find(Boolean)?.number ?? import_github3.context.issue.number;
if (!prNumber) {
(0, import_core4.info)("No PR number found, skipping comment creation.");
return;
}
const { data: comments } = await octokit.rest.issues.listComments({
issue_number: prNumber,
...import_github3.context.repo
Expand Down
2 changes: 1 addition & 1 deletion action/dist/main.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion action/src/comment.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { octokit } from './octokit';
import { context } from '@actions/github';
import { getInput } from '@actions/core';
import { getInput, info } from '@actions/core';
import { buildComparadiseUrl } from './build-comparadise-url';

export const createGithubComment = async () => {
Expand All @@ -22,6 +22,10 @@ export const createGithubComment = async () => {
...context.repo
});
const prNumber = data.find(Boolean)?.number ?? context.issue.number;
if (!prNumber) {
info('No PR number found, skipping comment creation.');
return;
}

const { data: comments } = await octokit.rest.issues.listComments({
issue_number: prNumber,
Expand Down
Loading