Skip to content

Commit

Permalink
ci: UPDATE_STUDIO should commit changes [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed Apr 29, 2020
1 parent 51a4730 commit e301d5f
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions src/scripts/ci/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,8 @@ async function pull(dir: string, dry = false): Promise<void> {
if (!process.env.GITHUB_TOKEN) {
throw new Error(`Missing env var GITHUB_TOKEN`)
}
await run(
dir,
`git remote set-url origin-push https://${process.env.GITHUB_TOKEN}@github.com/prisma/prisma.git`,
dry,
)
}
await run(dir, `git pull origin-push ${branch} --no-edit`)
await run(dir, `git pull origin ${branch} --no-edit`)
}

async function push(dir: string, dry = false): Promise<void> {
Expand All @@ -88,14 +83,9 @@ async function push(dir: string, dry = false): Promise<void> {
if (!process.env.GITHUB_TOKEN) {
throw new Error(`Missing env var GITHUB_TOKEN`)
}
await run(
dir,
`git remote set-url origin-push https://${process.env.GITHUB_TOKEN}@github.com/prisma/prisma.git`,
dry,
)
await run(dir, `git push --quiet --set-upstream origin-push ${branch}`, dry)
await run(dir, `git push --quiet --set-upstream origin ${branch}`, dry)
} else {
await run(dir, `git push origin-push ${branch}`, dry)
await run(dir, `git push origin ${branch}`, dry)
}
}

Expand Down Expand Up @@ -772,13 +762,7 @@ async function publishPackages(
if (process.env.UPDATE_STUDIO) {
await run('.', `git config --global user.email "prismabots@gmail.com"`)
await run('.', `git config --global user.name "prisma-bot"`)
await run(
'.',
`git remote add origin-push https://${process.env.GITHUB_TOKEN}@github.com/prisma/prisma.git`,
dryRun,
)
await run('.', `git fetch`, dryRun)
await run('.', `git branch --set-upstream-to origin-push master`, dryRun)
await run('.', `git checkout master`, dryRun)
}

// for now only push when studio is being updated
Expand Down

0 comments on commit e301d5f

Please sign in to comment.