[tests] Fix next update cron job (#10214)

This was supposed to be fixed in https://github.com/vercel/vercel/pull/10173 but the file was created after git commit.

This PR makes sure the file is created before git commit.
This commit is contained in:
Steven
2023-07-14 12:07:26 -04:00
committed by GitHub
parent cae60155f3
commit b61674cb2d
2 changed files with 4 additions and 3 deletions

View File

@@ -0,0 +1,2 @@
---
---

View File

@@ -38,6 +38,8 @@ module.exports = async ({ github, context } = {}) => {
.next;
if (github && oldVersion !== newVersion) {
updatedCount++;
const changeset = join(__dirname, '..', '.changeset', `${branch}.md`);
writeFileSync(changeset, `---\n---\n\n`, 'utf-8');
exec('rm', ['-rf', './examples/nextjs']);
exec('npx', ['--yes', 'create-next-app@latest', './examples/nextjs']);
exec('git', [
@@ -96,9 +98,6 @@ module.exports = async ({ github, context } = {}) => {
} to Next.js version ${newVersion}`
);
const changeset = join(__dirname, '..', '.changeset', `${branch}.md`);
writeFileSync(changeset, `---\n---\n\n`, 'utf-8');
if (!github || !context) {
console.error('Error: missing github or context');
return;