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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
node_modules
node_modules


.DS_Store
17 changes: 17 additions & 0 deletions actions/cnb-delete-branch/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CNB Delete Branch
description: Delete branch from CNB (Gitea) after closing associated PRs

inputs:
token:
description: CNB API Token
required: true
repo:
description: Repository name
required: true
branch:
description: Branch name
required: true

runs:
using: node24
main: ../../packages/cnb-delete-branch/dist/index.mjs
232 changes: 218 additions & 14 deletions packages/close-release-issue/dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ import * as os$1 from "os";
import os, { EOL } from "os";
import * as fs from "fs";
import { constants, existsSync, promises, readFileSync } from "fs";
import * as path from "path";
import * as events from "events";
import "child_process";
import "timers";
//#region \0rolldown/runtime.js
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
Expand Down Expand Up @@ -118,7 +122,7 @@ var require_tunnel$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
var tls = __require("tls");
var http$2 = __require("http");
var https$1 = __require("https");
var events = __require("events");
var events$1 = __require("events");
__require("assert");
var util$2 = __require("util");
exports.httpOverHttp = httpOverHttp;
Expand Down Expand Up @@ -170,7 +174,7 @@ var require_tunnel$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
self.removeSocket(socket);
});
}
util$2.inherits(TunnelingAgent, events.EventEmitter);
util$2.inherits(TunnelingAgent, events$1.EventEmitter);
TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
var self = this;
var options = mergeOptions({ request: req }, self.options, toOptions(host, port, localAddress));
Expand Down Expand Up @@ -3801,6 +3805,12 @@ var require_util$6 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) return "no-referrer";
return referrerOrigin;
}
/**
* 1. If referrerURL is a potentially trustworthy URL and
* request’s current URL is not a potentially trustworthy URL,
* then return no referrer.
* 2. Return referrerOrigin
*/
default: return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin;
}
}
Expand Down Expand Up @@ -4416,11 +4426,14 @@ var require_file = /* @__PURE__ */ __commonJSMin(((exports, module) => {
const { webidl } = require_webidl();
var FileLike = class FileLike {
constructor(blobLike, fileName, options = {}) {
const n = fileName;
const t = options.type;
const d = options.lastModified ?? Date.now();
this[kState] = {
blobLike,
name: fileName,
type: options.type,
lastModified: options.lastModified ?? Date.now()
name: n,
type: t,
lastModified: d
};
}
stream(...args) {
Expand Down Expand Up @@ -15841,10 +15854,191 @@ var Summary = class {
}
};
new Summary();
//#endregion
//#region ../../node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io-util.js
var __awaiter$6 = function(thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P ? value : new P(function(resolve) {
resolve(value);
});
}
return new (P || (P = Promise))(function(resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
const { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs.promises;
process.platform;
const IS_WINDOWS$1 = process.platform === "win32";
fs.constants.O_RDONLY;
/**
* On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
* \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
*/
function isRooted(p) {
p = normalizeSeparators(p);
if (!p) throw new Error("isRooted() parameter \"p\" cannot be empty");
if (IS_WINDOWS$1) return p.startsWith("\\") || /^[A-Z]:/i.test(p);
return p.startsWith("/");
}
/**
* Best effort attempt to determine whether a file exists and is executable.
* @param filePath file path to check
* @param extensions additional file extensions to try
* @return if file exists and is executable, returns the file path. otherwise empty string.
*/
function tryGetExecutablePath(filePath, extensions) {
return __awaiter$6(this, void 0, void 0, function* () {
let stats = void 0;
try {
stats = yield stat(filePath);
} catch (err) {
if (err.code !== "ENOENT") console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
}
if (stats && stats.isFile()) {
if (IS_WINDOWS$1) {
const upperExt = path.extname(filePath).toUpperCase();
if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) return filePath;
} else if (isUnixExecutable(stats)) return filePath;
}
const originalFilePath = filePath;
for (const extension of extensions) {
filePath = originalFilePath + extension;
stats = void 0;
try {
stats = yield stat(filePath);
} catch (err) {
if (err.code !== "ENOENT") console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
}
if (stats && stats.isFile()) {
if (IS_WINDOWS$1) {
try {
const directory = path.dirname(filePath);
const upperName = path.basename(filePath).toUpperCase();
for (const actualName of yield readdir(directory)) if (upperName === actualName.toUpperCase()) {
filePath = path.join(directory, actualName);
break;
}
} catch (err) {
console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
}
return filePath;
} else if (isUnixExecutable(stats)) return filePath;
}
}
return "";
});
}
function normalizeSeparators(p) {
p = p || "";
if (IS_WINDOWS$1) {
p = p.replace(/\//g, "\\");
return p.replace(/\\\\+/g, "\\");
}
return p.replace(/\/\/+/g, "/");
}
function isUnixExecutable(stats) {
return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && process.getgid !== void 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && process.getuid !== void 0 && stats.uid === process.getuid();
}
//#endregion
//#region ../../node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io.js
var __awaiter$5 = function(thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P ? value : new P(function(resolve) {
resolve(value);
});
}
return new (P || (P = Promise))(function(resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
/**
* Returns path of a tool had the tool actually been invoked. Resolves via paths.
* If you check and the tool does not exist, it will throw.
*
* @param tool name of the tool
* @param check whether to check if tool exists
* @returns Promise<string> path to tool
*/
function which(tool, check) {
return __awaiter$5(this, void 0, void 0, function* () {
if (!tool) throw new Error("parameter 'tool' is required");
if (check) {
const result = yield which(tool, false);
if (!result) if (IS_WINDOWS$1) throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
else throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
return result;
}
const matches = yield findInPath(tool);
if (matches && matches.length > 0) return matches[0];
return "";
});
}
/**
* Returns a list of all occurrences of the given tool on the system path.
*
* @returns Promise<string[]> the paths of the tool
*/
function findInPath(tool) {
return __awaiter$5(this, void 0, void 0, function* () {
if (!tool) throw new Error("parameter 'tool' is required");
const extensions = [];
if (IS_WINDOWS$1 && process.env["PATHEXT"]) {
for (const extension of process.env["PATHEXT"].split(path.delimiter)) if (extension) extensions.push(extension);
}
if (isRooted(tool)) {
const filePath = yield tryGetExecutablePath(tool, extensions);
if (filePath) return [filePath];
return [];
}
if (tool.includes(path.sep)) return [];
const directories = [];
if (process.env.PATH) {
for (const p of process.env.PATH.split(path.delimiter)) if (p) directories.push(p);
}
const matches = [];
for (const directory of directories) {
const filePath = yield tryGetExecutablePath(path.join(directory, tool), extensions);
if (filePath) matches.push(filePath);
}
return matches;
});
}
process.platform;
events.EventEmitter;
events.EventEmitter;
os.platform();
os.arch();
/**
Expand Down Expand Up @@ -15933,7 +16127,7 @@ function endGroup() {
issue("endgroup");
}
//#endregion
//#region ../../node_modules/.pnpm/@actions+github@9.0.0/node_modules/@actions/github/lib/context.js
//#region ../../node_modules/.pnpm/@actions+github@9.1.0/node_modules/@actions/github/lib/context.js
var Context = class {
/**
* Hydrate the context from the environment
Expand Down Expand Up @@ -16033,7 +16227,7 @@ var require_proxy = /* @__PURE__ */ __commonJSMin(((exports) => {
};
}));
//#endregion
//#region ../../node_modules/.pnpm/@actions+github@9.0.0/node_modules/@actions/github/lib/internal/utils.js
//#region ../../node_modules/.pnpm/@actions+github@9.1.0/node_modules/@actions/github/lib/internal/utils.js
var import_lib = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports) => {
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
if (k2 === void 0) k2 = k;
Expand Down Expand Up @@ -16668,6 +16862,16 @@ function getProxyFetch(destinationUrl) {
function getApiBaseUrl() {
return process.env["GITHUB_API_URL"] || "https://api.github.com";
}
function getUserAgentWithOrchestrationId(baseUserAgent) {
var _a;
const orchId = (_a = process.env["ACTIONS_ORCHESTRATION_ID"]) === null || _a === void 0 ? void 0 : _a.trim();
if (orchId) {
const tag = `actions_orchestration_id/${orchId.replace(/[^a-z0-9_.-]/gi, "_")}`;
if (baseUserAgent === null || baseUserAgent === void 0 ? void 0 : baseUserAgent.includes(tag)) return baseUserAgent;
return `${baseUserAgent ? `${baseUserAgent} ` : ""}${tag}`;
}
return baseUserAgent;
}
//#endregion
//#region ../../node_modules/.pnpm/universal-user-agent@7.0.3/node_modules/universal-user-agent/index.js
function getUserAgent() {
Expand Down Expand Up @@ -16768,13 +16972,12 @@ var before_after_hook_default = {
};
//#endregion
//#region ../../node_modules/.pnpm/@octokit+endpoint@11.0.2/node_modules/@octokit/endpoint/dist-bundle/index.js
var userAgent = `octokit-endpoint.js/0.0.0-development ${getUserAgent()}`;
var DEFAULTS = {
method: "GET",
baseUrl: "https://api.github.com",
headers: {
accept: "application/vnd.github.v3+json",
"user-agent": userAgent
"user-agent": `octokit-endpoint.js/0.0.0-development ${getUserAgent()}`
},
mediaType: { format: "" }
};
Expand Down Expand Up @@ -17128,8 +17331,7 @@ var RequestError = class extends Error {
};
//#endregion
//#region ../../node_modules/.pnpm/@octokit+request@10.0.7/node_modules/@octokit/request/dist-bundle/index.js
var VERSION$4 = "10.0.7";
var defaults_default = { headers: { "user-agent": `octokit-request.js/${VERSION$4} ${getUserAgent()}` } };
var defaults_default = { headers: { "user-agent": `octokit-request.js/10.0.7 ${getUserAgent()}` } };
function isPlainObject(value) {
if (typeof value !== "object" || value === null) return false;
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
Expand Down Expand Up @@ -18981,10 +19183,12 @@ function getOctokitOptions(token, options) {
const opts = Object.assign({}, options || {});
const auth = getAuthString(token, opts);
if (auth) opts.auth = auth;
const userAgent = getUserAgentWithOrchestrationId(opts.userAgent);
if (userAgent) opts.userAgent = userAgent;
return opts;
}
//#endregion
//#region ../../node_modules/.pnpm/@actions+github@9.0.0/node_modules/@actions/github/lib/github.js
//#region ../../node_modules/.pnpm/@actions+github@9.1.0/node_modules/@actions/github/lib/github.js
const context = new Context();
/**
* Returns a hydrated octokit ready to use for GitHub Actions
Expand Down
Loading
Loading