This commit is contained in:
Trym Lund Flogard 2021-06-02 16:36:55 +02:00
parent 146df697b5
commit 83cbe577f4
4 changed files with 1047 additions and 388 deletions

1416
dist/index.js vendored

File diff suppressed because it is too large Load Diff

11
package-lock.json generated
View File

@ -182,6 +182,12 @@
"form-data": "^3.0.0"
}
},
"@types/uuid": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz",
"integrity": "sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ==",
"dev": true
},
"archiver": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.0.tgz",
@ -602,6 +608,11 @@
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",

View File

@ -24,13 +24,15 @@
"@actions/glob": "^0.1.2",
"archiver": "^5.3.0",
"btoa": "^1.2.1",
"node-fetch": "^2.6.1"
"node-fetch": "^2.6.1",
"uuid": "^8.3.2"
},
"devDependencies": {
"@types/archiver": "^5.1.0",
"@types/btoa": "^1.2.3",
"@types/node": "^15.6.2",
"@types/node-fetch": "^2.5.10",
"@types/uuid": "^8.3.0",
"typescript": "^4.3.2"
}
}

View File

@ -2,12 +2,12 @@ import * as fsSync from 'fs'
import * as path from 'path'
import * as core from '@actions/core';
import * as os from 'os';
import * as crypto from 'crypto';
import * as archiver from 'archiver';
import { URL } from 'url';
import fetch, { HeadersInit } from 'node-fetch';
import { Inputs } from '../Inputs';
import btoa from 'btoa';
import { v4 as uuidv4 } from 'uuid';
const fs = fsSync.promises;
@ -24,7 +24,7 @@ export class NextcloudClient {
private endpoint: string,
private artifact: string,
private rootDirectory: string) {
this.guid = crypto.randomUUID({ disableEntropyCache: false });
this.guid = uuidv4();
this.headers = {'Authorization': 'Basic ' + btoa(`${Inputs.Username}:${Inputs.Password}`)};
}