This commit is contained in:
Trym Lund Flogard 2021-06-05 13:30:57 +02:00
parent 02b35dd9a1
commit a5df11eaca
4 changed files with 9 additions and 3 deletions

5
dist/index.js vendored
View File

@ -395,7 +395,8 @@ class NextcloudArtifact {
conclusion: 'failure',
status: 'completed',
output: {
title: 'Nextcloud Artifacts'
title: 'Nextcloud Artifacts',
summary: 'Check failed.'
},
...github.context.repo
});
@ -630,8 +631,10 @@ class NextcloudClient {
body: JSON.stringify(body)
});
const result = await res.text();
core.debug(`Share response: ${result}`);
const re = /<url>(?<share_url>.*)<\/url>/;
const match = re.exec(result);
core.debug(`Match groups:\n${JSON.stringify(match === null || match === void 0 ? void 0 : match.groups)}`);
const sharableUrl = ((match === null || match === void 0 ? void 0 : match.groups) || {})['share_url'];
if (!sharableUrl) {
throw new Error('Failed to parse sharable URL.');

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -108,7 +108,8 @@ export class NextcloudArtifact {
conclusion: 'failure',
status: 'completed',
output: {
title: 'Nextcloud Artifacts'
title: 'Nextcloud Artifacts',
summary: 'Check failed.'
},
...github.context.repo
})

View File

@ -193,8 +193,10 @@ export class NextcloudClient {
})
const result = await res.text()
core.debug(`Share response: ${result}`)
const re = /<url>(?<share_url>.*)<\/url>/
const match = re.exec(result)
core.debug(`Match groups:\n${JSON.stringify(match?.groups)}`)
const sharableUrl = (match?.groups || {})['share_url']
if (!sharableUrl) {
throw new Error('Failed to parse sharable URL.')