Skip to content

Commit

Permalink
Add check for missing package name in updatePackageJson
Browse files Browse the repository at this point in the history
  • Loading branch information
jill64 committed Dec 20, 2023
1 parent 5531c87 commit ad5f4d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/action/src/ghosts/docs/updatePackageJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export const updatePackageJson =
return false
}

if (!packageJson?.name) {
core.info(`[${packageJsonPath}]: No name found.`)
return false
}

Check warning on line 33 in packages/action/src/ghosts/docs/updatePackageJson.ts

View check run for this annotation

Codecov / codecov/patch

packages/action/src/ghosts/docs/updatePackageJson.ts#L29-L33

Added lines #L29 - L33 were not covered by tests
const isRepoRoot =
path.relative(process.cwd(), packageJsonPath) === 'package.json'

Expand Down

0 comments on commit ad5f4d7

Please sign in to comment.