diff --git a/pages/[[...path]].tsx b/pages/[[...path]].tsx index df5e02f..43e6085 100644 --- a/pages/[[...path]].tsx +++ b/pages/[[...path]].tsx @@ -85,7 +85,7 @@ export const getStaticPaths: GetStaticPaths = async () => { const ref = await octokit.rest.git.getRef({ owner: process.env.NEXT_PUBLIC_OWNER, repo: process.env.NEXT_PUBLIC_REPO.replace( - `${process.env.NEXT_PUBLIC_OWNER}/`, + new RegExp(`^${process.env.NEXT_PUBLIC_OWNER}/`), '', ), ref: process.env.NEXT_PUBLIC_REF.replace(/^refs\//, ''), @@ -93,7 +93,7 @@ export const getStaticPaths: GetStaticPaths = async () => { const tree = await octokit.rest.git.getTree({ owner: process.env.NEXT_PUBLIC_OWNER, repo: process.env.NEXT_PUBLIC_REPO.replace( - `${process.env.NEXT_PUBLIC_OWNER}/`, + new RegExp(`^${process.env.NEXT_PUBLIC_OWNER}/`), '', ), tree_sha: ref.data.object.sha, @@ -135,7 +135,7 @@ export const getStaticProps: GetStaticProps = async ( const content = await octokit.rest.repos.getContent({ owner: process.env.NEXT_PUBLIC_OWNER, repo: process.env.NEXT_PUBLIC_REPO.replace( - `${process.env.NEXT_PUBLIC_OWNER}/`, + new RegExp(`^${process.env.NEXT_PUBLIC_OWNER}/`), '', ), ref: process.env.NEXT_PUBLIC_REF.replace(/^refs\//, ''),