Skip to content

Commit

Permalink
Merge pull request #413 from jill64/dev
Browse files Browse the repository at this point in the history
Refactor updateReadme function
  • Loading branch information
wraith-ci[bot] authored Dec 20, 2023
2 parents 9b2e7f7 + ec19691 commit 32909ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 0 additions & 4 deletions packages/action/dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -34302,10 +34302,6 @@ var updateReadme = ({
workflowFiles
}) => async (readmePath) => {
const readme = await (0, import_promises5.readFile)(readmePath, "utf-8");
if (!readme) {
core_exports.info(`[${readmePath}]: No readme found.`);
return false;
}
const dir = import_node_path3.default.dirname(readmePath);
const packageJsonPath = import_node_path3.default.join(dir, "package.json");
const packageJsonStr = await (0, import_promises5.readFile)(packageJsonPath, "utf-8");
Expand Down
8 changes: 2 additions & 6 deletions packages/action/src/ghosts/docs/updateReadme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@ export const updateReadme =
}) =>
async (readmePath: string): Promise<boolean> => {
const readme = await readFile(readmePath, 'utf-8')

if (!readme) {
core.info(`[${readmePath}]: No readme found.`)
return false
}

const dir = path.dirname(readmePath)

const packageJsonPath = path.join(dir, 'package.json')
const packageJsonStr = await readFile(packageJsonPath, 'utf-8')

const json = JSON.parse(packageJsonStr)
const packageJson = isValidPackageJson(json) ? json : null

Expand Down

0 comments on commit 32909ea

Please sign in to comment.