Skip to content

Commit

Permalink
Merge pull request #43 from juanfra/fix/preview-link-forks
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrgicak authored Nov 4, 2024
2 parents 79445f5 + a8c5e84 commit 7b67470
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
12 changes: 5 additions & 7 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/create-preview-links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function createBlueprint(
};

const template: Template = {
preferredVersions,
...(Object.keys(preferredVersions).length && { preferredVersions }),
steps: [
{
step: 'login',
Expand Down Expand Up @@ -155,7 +155,11 @@ export default async function createPreviewLinksComment(

debug(`Pull request found: #${pullRequest.number}`);

const repo = `${context.repo.owner}/${context.repo.repo}`;
const isFork = pullRequest.head.repo?.fork;

const repo = isFork
? `${pullRequest.head.repo.owner.login}/${pullRequest.head.repo.name}`
: `${context.repo.owner}/${context.repo.repo}`;

const isSingleTheme = getInput('single-theme') === 'true';
let previewLinks = '';
Expand Down

0 comments on commit 7b67470

Please sign in to comment.