diff --git a/.github/actions/next-stats-action/src/index.js b/.github/actions/next-stats-action/src/index.js index 23ea3882c5..ce7bdd50f9 100644 --- a/.github/actions/next-stats-action/src/index.js +++ b/.github/actions/next-stats-action/src/index.js @@ -41,8 +41,7 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) { // clone PR/newer repository/ref first to get settings if (!actionInfo.skipClone) { - await cloneRepo(actionInfo.prRepo, diffRepoDir) - await checkoutRef(actionInfo.prRef, diffRepoDir) + await cloneRepo(actionInfo.prRepo, diffRepoDir, actionInfo.prRef) } if (actionInfo.isRelease) { @@ -67,8 +66,7 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) { // clone main repository/ref if (!actionInfo.skipClone) { - await cloneRepo(statsConfig.mainRepo, mainRepoDir) - await checkoutRef(statsConfig.mainBranch, mainRepoDir) + await cloneRepo(statsConfig.mainRepo, mainRepoDir, statsConfig.mainBranch) } /* eslint-disable-next-line */ actionInfo.commitId = await getCommitId(diffRepoDir) diff --git a/.github/actions/next-stats-action/src/prepare/repo-setup.js b/.github/actions/next-stats-action/src/prepare/repo-setup.js index e64655f4e4..4b971162bc 100644 --- a/.github/actions/next-stats-action/src/prepare/repo-setup.js +++ b/.github/actions/next-stats-action/src/prepare/repo-setup.js @@ -8,12 +8,11 @@ const execa = require('execa') module.exports = (actionInfo) => { return { - async cloneRepo(repoPath = '', dest = '') { + async cloneRepo(repoPath = '', dest = '', branch = '', depth = '20') { await remove(dest) - await exec(`git clone ${actionInfo.gitRoot}${repoPath} ${dest}`) - }, - async checkoutRef(ref = '', repoDir = '') { - await exec(`cd ${repoDir} && git fetch && git checkout ${ref}`) + await exec( + `git clone ${actionInfo.gitRoot}${repoPath} --single-branch --branch ${branch} --depth=${depth} ${dest}` + ) }, async getLastStable(repoDir = '', ref) { const { stdout } = await exec(`cd ${repoDir} && git tag -l`) diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml index 000f78e022..c0962d685a 100644 --- a/.github/workflows/trigger_release.yml +++ b/.github/workflows/trigger_release.yml @@ -49,7 +49,7 @@ jobs: node-version: 18 check-latest: true - - run: git clone https://ijjk:${{ secrets.START_RELEASE_TOKEN }}@github.com/vercel/next.js.git --depth=25 . + - run: git clone https://github.com/vercel/next.js.git --depth=25 . - run: git describe || 'echo failed to get tag'