@@ -29910,13 +29910,19 @@ function getBlob(filePath) {
2991029910
2991129911
2991229912Object.defineProperty(exports, "__esModule", ({ value: true }));
29913- exports.BranchCommitNotFound = exports.BranchNotFound = exports.InputBranchNotFound = exports.NoFileChanges = void 0;
29913+ exports.BranchCommitNotFound = exports.BranchNotFound = exports.InputBranchNotFound = exports.InputRepositoryInvalid = exports. NoFileChanges = void 0;
2991429914class NoFileChanges extends Error {
2991529915 constructor() {
2991629916 super('No files changes');
2991729917 }
2991829918}
2991929919exports.NoFileChanges = NoFileChanges;
29920+ class InputRepositoryInvalid extends Error {
29921+ constructor(repository) {
29922+ super(`Input <repository> "${repository}" is invalid`);
29923+ }
29924+ }
29925+ exports.InputRepositoryInvalid = InputRepositoryInvalid;
2992029926class InputBranchNotFound extends Error {
2992129927 constructor(branchName) {
2992229928 super(`Input <branch-name> "${branchName}" not found`);
@@ -30388,15 +30394,22 @@ function run() {
3038830394 var _a, _b, _c, _d, _e, _f;
3038930395 try {
3039030396 const { owner, repo, branch } = (0, repo_1.getContext)();
30397+ const inputRepository = (0, input_1.getInput)('repository');
3039130398 const inputBranch = (0, input_1.getInput)('branch-name');
3039230399 if (inputBranch && inputBranch !== branch) {
3039330400 yield (0, git_1.switchBranch)(inputBranch);
3039430401 yield (0, git_1.pushCurrentBranch)();
3039530402 }
30403+ const repositoryParts = inputRepository ? inputRepository.split('/') : [];
30404+ if (repositoryParts.length && repositoryParts.length != 2) {
30405+ throw new errors_1.InputRepositoryInvalid(inputRepository);
30406+ }
30407+ const currentOwner = repositoryParts.length ? repositoryParts[0] : owner;
30408+ const currentRepository = repositoryParts.length ? repositoryParts[1] : repo;
3039630409 const currentBranch = inputBranch ? inputBranch : branch;
30397- const repository = yield core.group(`fetching repository info for owner: ${owner }, repo: ${repo }, branch: ${currentBranch}`, () => __awaiter(this, void 0, void 0, function* () {
30410+ const repository = yield core.group(`fetching repository info for owner: ${currentOwner }, repo: ${currentRepository }, branch: ${currentBranch}`, () => __awaiter(this, void 0, void 0, function* () {
3039830411 const startTime = Date.now();
30399- const repositoryData = yield (0, graphql_1.getRepository)(owner, repo , currentBranch);
30412+ const repositoryData = yield (0, graphql_1.getRepository)(currentOwner, currentRepository , currentBranch);
3040030413 const endTime = Date.now();
3040130414 core.debug(`time taken: ${(endTime - startTime).toString()} ms`);
3040230415 return repositoryData;
0 commit comments