Skip to content

Conversation

@Tenemo
Copy link
Owner

@Tenemo Tenemo commented Oct 18, 2025

No description provided.

Copilot AI review requested due to automatic review settings October 18, 2025 09:42
@netlify
Copy link

netlify bot commented Oct 18, 2025

Deploy Preview for piech-dev ready!

Name Link
🔨 Latest commit 30eb263
🔍 Latest deploy log https://app.netlify.com/projects/piech-dev/deploys/68f362241e35cc0008333dc4
😎 Deploy Preview https://deploy-preview-14--piech-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100
Accessibility: 100
Best Practices: 100
SEO: 100
PWA: 90
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the GitHub data fetching logic to support both 'master' and 'main' branch naming conventions when retrieving package.json license information. The changes improve code readability and maintainability by restructuring conditional logic and adding fallback branch support.

Key changes:

  • Added fallback logic to check both 'master' and 'main' branches when fetching package.json
  • Refactored nested type checking for license object to improve code clarity
  • Updated comments to reflect the new multi-branch fallback behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +119 to +123
for (const branch of candidateBranches) {
try {
const pkg = JSON.parse(raw) as unknown;
if (
pkg &&
typeof pkg === 'object' &&
'license' in (pkg as Record<string, unknown>)
) {
const lic = (pkg as Record<string, unknown>).license;
if (typeof lic === 'string') return lic;
const raw = await fetchText(
`https://raw.githubusercontent.com/${owner}/${repo}/${branch}/package.json`,
);
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loop will continue attempting to fetch from 'main' even after successfully retrieving and parsing a license from 'master'. Consider adding an early return after successfully finding a valid license to avoid unnecessary network requests.

Copilot uses AI. Check for mistakes.
@Tenemo Tenemo merged commit 7c0d006 into master Oct 18, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants