Skip to content

Commit

Permalink
output skylink-url even without issue number
Browse files Browse the repository at this point in the history
  • Loading branch information
kwypchlo committed Nov 4, 2020
1 parent 03c5b85 commit d2d0af4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d2d0af4

Please sign in to comment.