@@ -8,7 +8,11 @@ require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap
88
99var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1010 if (k2 === undefined) k2 = k;
11- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11+ var desc = Object.getOwnPropertyDescriptor(m, k);
12+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13+ desc = { enumerable: true, get: function() { return m[k]; } };
14+ }
15+ Object.defineProperty(o, k2, desc);
1216}) : (function(o, m, k, k2) {
1317 if (k2 === undefined) k2 = k;
1418 o[k2] = m[k];
@@ -49,6 +53,9 @@ class ActionInputs {
4953 get Token() {
5054 return core.getInput('token', { required: true });
5155 }
56+ get NoZip() {
57+ return Boolean(core.getInput('no-zip', { required: false }));
58+ }
5259 get NoFileBehvaior() {
5360 const notFoundAction = core.getInput('if-no-files-found', { required: false }) || NoFileOption_1.NoFileOption.warn;
5461 const noFileBehavior = NoFileOption_1.NoFileOption[notFoundAction];
@@ -70,7 +77,11 @@ exports.ActionInputs = ActionInputs;
7077
7178var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7279 if (k2 === undefined) k2 = k;
73- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
80+ var desc = Object.getOwnPropertyDescriptor(m, k);
81+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
82+ desc = { enumerable: true, get: function() { return m[k]; } };
83+ }
84+ Object.defineProperty(o, k2, desc);
7485}) : (function(o, m, k, k2) {
7586 if (k2 === undefined) k2 = k;
7687 o[k2] = m[k];
@@ -89,12 +100,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
89100};
90101Object.defineProperty(exports, "__esModule", ({ value: true }));
91102exports.FileFinder = void 0;
92- const glob = __importStar(__nccwpck_require__(8090 ));
93- const fs_1 = __nccwpck_require__(5747 );
94- const core_1 = __nccwpck_require__(2186 );
95- const path = __importStar(__nccwpck_require__(5622 ));
96- const util_1 = __nccwpck_require__(1669 );
97- const stats = util_1.promisify(fs_1.stat);
103+ const glob = __importStar(__nccwpck_require__(203 ));
104+ const fs_1 = __nccwpck_require__(7147 );
105+ const core_1 = __nccwpck_require__(3722 );
106+ const path = __importStar(__nccwpck_require__(1017 ));
107+ const util_1 = __nccwpck_require__(3837 );
108+ const stats = (0, util_1.promisify) (fs_1.stat);
98109class FileFinder {
99110 constructor(searchPath, globOptions) {
100111 this.searchPath = searchPath;
@@ -117,26 +128,26 @@ class FileFinder {
117128 const fileStats = await stats(searchResult);
118129 // isDirectory() returns false for symlinks if using fs.lstat(), make sure to use fs.stat() instead
119130 if (!fileStats.isDirectory()) {
120- core_1.debug(`File:${searchResult} was found using the provided searchPath`);
131+ (0, core_1.debug) (`File:${searchResult} was found using the provided searchPath`);
121132 searchResults.push(searchResult);
122133 // detect any files that would be overwritten because of case insensitivity
123134 if (set.has(searchResult.toLowerCase())) {
124- core_1.info(`Uploads are case insensitive: ${searchResult} was detected that it will be overwritten by another file with the same path`);
135+ (0, core_1.info) (`Uploads are case insensitive: ${searchResult} was detected that it will be overwritten by another file with the same path`);
125136 }
126137 else {
127138 set.add(searchResult.toLowerCase());
128139 }
129140 }
130141 else {
131- core_1.debug(`Removing ${searchResult} from rawSearchResults because it is a directory`);
142+ (0, core_1.debug) (`Removing ${searchResult} from rawSearchResults because it is a directory`);
132143 }
133144 }
134145 // Calculate the root directory for the artifact using the search paths that were utilized
135146 const searchPaths = globber.getSearchPaths();
136147 if (searchPaths.length > 1) {
137- core_1.info(`Multiple search paths detected. Calculating the least common ancestor of all paths`);
148+ (0, core_1.info) (`Multiple search paths detected. Calculating the least common ancestor of all paths`);
138149 const lcaSearchPath = this.getMultiPathLCA(searchPaths);
139- core_1.info(`The least common ancestor is ${lcaSearchPath}. This will be the root directory of the artifact`);
150+ (0, core_1.info) (`The least common ancestor is ${lcaSearchPath}. This will be the root directory of the artifact`);
140151 return {
141152 filesToUpload: searchResults,
142153 rootDirectory: lcaSearchPath
@@ -166,7 +177,7 @@ class FileFinder {
166177 let smallestPathLength = Number.MAX_SAFE_INTEGER;
167178 // split each of the search paths using the platform specific separator
168179 for (const searchPath of searchPaths) {
169- core_1.debug(`Using search path ${searchPath}`);
180+ (0, core_1.debug) (`Using search path ${searchPath}`);
170181 const splitSearchPath = path.normalize(searchPath).split(path.sep);
171182 // keep track of the smallest path length so that we don't accidentally later go out of bounds
172183 smallestPathLength = Math.min(smallestPathLength, splitSearchPath.length);
@@ -243,7 +254,11 @@ var NoFileOption;
243254
244255var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
245256 if (k2 === undefined) k2 = k;
246- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
257+ var desc = Object.getOwnPropertyDescriptor(m, k);
258+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
259+ desc = { enumerable: true, get: function() { return m[k]; } };
260+ }
261+ Object.defineProperty(o, k2, desc);
247262}) : (function(o, m, k, k2) {
248263 if (k2 === undefined) k2 = k;
249264 o[k2] = m[k];
@@ -286,7 +301,11 @@ run();
286301
287302var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
288303 if (k2 === undefined) k2 = k;
289- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
304+ var desc = Object.getOwnPropertyDescriptor(m, k);
305+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
306+ desc = { enumerable: true, get: function() { return m[k]; } };
307+ }
308+ Object.defineProperty(o, k2, desc);
290309}) : (function(o, m, k, k2) {
291310 if (k2 === undefined) k2 = k;
292311 o[k2] = m[k];
@@ -364,10 +383,11 @@ class NextcloudArtifact {
364383 },
365384 ...github.context.repo
366385 });
367- const client = new NextcloudClient_1.NextcloudClient(this.inputs.Endpoint, this.name, files.rootDirectory, this.inputs.Username, this.inputs.Password);
386+ const client = new NextcloudClient_1.NextcloudClient(this.inputs.Endpoint, this.name, files.rootDirectory, this.inputs.Username, this.inputs.Password, this.inputs.NoZip );
368387 try {
369388 const shareableUrl = await client.uploadFiles(files.filesToUpload);
370389 core.setOutput('SHAREABLE_URL', shareableUrl);
390+ core.setOutput('DIRECT_SHAREABLE_URL', `${shareableUrl}/download`);
371391 core.info(`Nextcloud shareable URL: ${shareableUrl}`);
372392 const resp = await this.octokit.rest.checks.update({
373393 check_run_id: createResp.data.id,
@@ -445,7 +465,11 @@ exports.NextcloudArtifact = NextcloudArtifact;
445465
446466var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
447467 if (k2 === undefined) k2 = k;
448- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
468+ var desc = Object.getOwnPropertyDescriptor(m, k);
469+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
470+ desc = { enumerable: true, get: function() { return m[k]; } };
471+ }
472+ Object.defineProperty(o, k2, desc);
449473}) : (function(o, m, k, k2) {
450474 if (k2 === undefined) k2 = k;
451475 o[k2] = m[k];
@@ -477,13 +501,14 @@ const uuid_1 = __nccwpck_require__(5840);
477501const webdav = __importStar(__nccwpck_require__(4032));
478502const fs = fsSync.promises;
479503class NextcloudClient {
480- constructor(endpoint, artifact, rootDirectory, username, password) {
504+ constructor(endpoint, artifact, rootDirectory, username, password, nozip ) {
481505 this.endpoint = endpoint;
482506 this.artifact = artifact;
483507 this.rootDirectory = rootDirectory;
484508 this.username = username;
485509 this.password = password;
486- this.guid = uuid_1.v4();
510+ this.nozip = nozip;
511+ this.guid = (0, uuid_1.v4)();
487512 this.headers = { Authorization: 'Basic ' + Buffer.from(`${this.username}:${this.password}`).toString('base64') };
488513 this.davClient = webdav.createClient(`${this.endpoint.href}remote.php/dav/files/${this.username}`, {
489514 username: this.username,
@@ -494,8 +519,16 @@ class NextcloudClient {
494519 async uploadFiles(files) {
495520 core.info('Preparing upload...');
496521 const spec = this.uploadSpec(files);
497- core.info('Zipping files...');
498- const zip = await this.zipFiles(spec);
522+ let zip;
523+ if (this.nozip) {
524+ if (spec.length > 1)
525+ throw Error('no-zip is incompatible with multiple file uploads.');
526+ zip = spec[0].absolutePath;
527+ }
528+ else {
529+ core.info('Zipping files...');
530+ zip = await this.zipFiles(spec);
531+ }
499532 try {
500533 core.info('Uploading to Nextcloud...');
501534 const filePath = await this.upload(zip);
@@ -570,9 +603,9 @@ class NextcloudClient {
570603 if (!(await this.davClient.exists(remoteFileDir))) {
571604 await this.davClient.createDirectory(remoteFileDir, { recursive: true });
572605 }
573- const remoteFilePath = `${remoteFileDir}/${this.artifact}. zip`;
606+ const remoteFilePath = `${remoteFileDir}/${this.artifact}${this.nozip ? '' : '. zip'} `;
574607 core.debug(`Transferring file... (${file})`);
575- await this.davClient.putFileContents(remoteFilePath, await fs.readFile (file));
608+ await this.davClient.putFileContents(remoteFilePath, fsSync.createReadStream (file));
576609 return remoteFilePath;
577610 }
578611 async shareFile(remoteFilePath) {
@@ -583,7 +616,7 @@ class NextcloudClient {
583616 publicUpload: 'false',
584617 permissions: 1
585618 };
586- const res = await node_fetch_1.default(url, {
619+ const res = await (0, node_fetch_1.default) (url, {
587620 method: 'POST',
588621 headers: Object.assign(this.headers, {
589622 'OCS-APIRequest': true,
0 commit comments