From d2d0af4bcb60b9dab656149c04c8c1b0021cd118 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 4 Nov 2020 13:24:56 +0100 Subject: [PATCH] output skylink-url even without issue number --- index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index e3fcc1a..8241ab3 100644 --- a/index.js +++ b/index.js @@ -27,19 +27,19 @@ function encodeBase32(input) { core.setOutput("skylink", skylink); console.log(`Skylink: ${skylink}`); + // generate base32 skylink from base64 skylink + const skylinkDecoded = decodeBase64(parseSkylink(skylink)); + const skylinkEncodedBase32 = encodeBase32(skylinkDecoded); + const skylinkUrl = `https://${skylinkEncodedBase32}.siasky.net`; + + core.setOutput("skylink-url", skylinkUrl); + console.log(`Deployed to: ${skylinkUrl}`); + // put a skylink in a pull request comment if available if (github.context.issue.number) { const gitHubToken = core.getInput("github-token"); const octokit = github.getOctokit(gitHubToken); - // generate base32 skylink from base64 skylink - const skylinkDecoded = decodeBase64(parseSkylink(skylink)); - const skylinkEncodedBase32 = encodeBase32(skylinkDecoded); - const skylinkUrl = `https://${skylinkEncodedBase32}.siasky.net`; - - core.setOutput("skylink-url", skylinkUrl); - console.log(`Deployed to: ${skylinkUrl}`); - try { await octokit.issues.createComment({ ...github.context.repo,