Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
18 changes: 14 additions & 4 deletions dist/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2811,8 +2811,18 @@ var require_dist_node5 = __commonJS({
module2.exports = __toCommonJS2(dist_src_exports);
var import_endpoint = require_dist_node2();
var import_universal_user_agent = require_dist_node();
var VERSION = "8.1.4";
var import_is_plain_object = require_is_plain_object();
var VERSION = "8.1.6";
function isPlainObject(value) {
if (typeof value !== "object" || value === null)
return false;
if (Object.prototype.toString.call(value) !== "[object Object]")
return false;
const proto = Object.getPrototypeOf(value);
if (proto === null)
return true;
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
}
var import_request_error = require_dist_node4();
function getBufferResponse(response) {
return response.arrayBuffer();
Expand All @@ -2821,7 +2831,7 @@ var require_dist_node5 = __commonJS({
var _a, _b, _c;
const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
if ((0, import_is_plain_object.isPlainObject)(requestOptions.body) || Array.isArray(requestOptions.body)) {
if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
requestOptions.body = JSON.stringify(requestOptions.body);
}
let headers = {};
Expand Down Expand Up @@ -2927,7 +2937,7 @@ var require_dist_node5 = __commonJS({
async function getResponseData(response) {
const contentType = response.headers.get("content-type");
if (/application\/json/.test(contentType)) {
return response.json();
return response.json().catch(() => response.text()).catch(() => "");
}
if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
return response.text();
Expand Down
18 changes: 14 additions & 4 deletions dist/post.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2811,8 +2811,18 @@ var require_dist_node5 = __commonJS({
module2.exports = __toCommonJS2(dist_src_exports);
var import_endpoint = require_dist_node2();
var import_universal_user_agent = require_dist_node();
var VERSION = "8.1.4";
var import_is_plain_object = require_is_plain_object();
var VERSION = "8.1.6";
function isPlainObject(value) {
if (typeof value !== "object" || value === null)
return false;
if (Object.prototype.toString.call(value) !== "[object Object]")
return false;
const proto = Object.getPrototypeOf(value);
if (proto === null)
return true;
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
}
var import_request_error = require_dist_node4();
function getBufferResponse(response) {
return response.arrayBuffer();
Expand All @@ -2821,7 +2831,7 @@ var require_dist_node5 = __commonJS({
var _a, _b, _c;
const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
if ((0, import_is_plain_object.isPlainObject)(requestOptions.body) || Array.isArray(requestOptions.body)) {
if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
requestOptions.body = JSON.stringify(requestOptions.body);
}
let headers = {};
Expand Down Expand Up @@ -2927,7 +2937,7 @@ var require_dist_node5 = __commonJS({
async function getResponseData(response) {
const contentType = response.headers.get("content-type");
if (/application\/json/.test(contentType)) {
return response.json();
return response.json().catch(() => response.text()).catch(() => "");
}
if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
return response.text();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "create-github-app-token",
"private": true,
"type": "module",
"version": "1.6.0",
"version": "1.6.1",
"description": "GitHub Action for creating a GitHub App Installation Access Token",
"scripts": {
"build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node20.0.0",
Expand Down

0 comments on commit 46e4a50

Please sign in to comment.