Skip to content

Commit

Permalink
feat: only shallow clone branches in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed May 22, 2024
1 parent 5b3b35a commit af89048
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"cac": "^6.7.14",
"execa": "^8.0.1",
"node-fetch-native": "^1.6.4",
"ofetch": "^1.3.4"
"ofetch": "^1.3.4",
"std-env": "^3.7.0"
},
"devDependencies": {
"@antfu/ni": "^0.21.12",
Expand Down
7 changes: 7 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { $fetch } from 'ofetch'
import actionsCore from '@actions/core'
// eslint-disable-next-line n/no-unpublished-import
import * as semver from 'semver'
import { isCI } from 'std-env'

const isGitHubActions = !!process.env.GITHUB_ACTIONS

Expand Down Expand Up @@ -98,7 +99,7 @@ export async function setupRepo(options: RepoOptions) {
options.branch = 'main'
}
if (options.shallow == null) {
options.shallow = true
options.shallow = isCI
}

let { repo, commit, branch, tag, dir, shallow } = options
Expand Down Expand Up @@ -337,7 +338,6 @@ export async function setupNuxtRepo(options: Partial<RepoOptions>) {
repo,
dir: nuxtPath,
branch: 'main',
shallow: true,
...options,
})

Expand Down

0 comments on commit af89048

Please sign in to comment.