mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 04:22:13 +00:00
Add changeset for @remix-run/dev updater GH Action (#9972)
Adds a changeset file when the GH Action to update `@remix-run/dev` creates a pull request.
This commit is contained in:
18
utils/update-remix-run-dev.js
vendored
18
utils/update-remix-run-dev.js
vendored
@@ -7,7 +7,8 @@ module.exports = async ({ github, context }, newVersion) => {
|
|||||||
execSync('git config --global user.name vercel-release-bot');
|
execSync('git config --global user.name vercel-release-bot');
|
||||||
execSync('git checkout main');
|
execSync('git checkout main');
|
||||||
|
|
||||||
const packagePath = path.join(__dirname, '..', 'packages', 'remix');
|
const repoRootPath = path.join(__dirname, '..');
|
||||||
|
const packagePath = path.join(repoRootPath, 'packages', 'remix');
|
||||||
const oldVersion = JSON.parse(
|
const oldVersion = JSON.parse(
|
||||||
fs.readFileSync(path.join(packagePath, 'package.json'), 'utf-8')
|
fs.readFileSync(path.join(packagePath, 'package.json'), 'utf-8')
|
||||||
).dependencies['@remix-run/dev'];
|
).dependencies['@remix-run/dev'];
|
||||||
@@ -42,6 +43,17 @@ module.exports = async ({ github, context }, newVersion) => {
|
|||||||
{ cwd: packagePath }
|
{ cwd: packagePath }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const changesetName = path.join(repoRootPath, `.changeset/${branch}.md`);
|
||||||
|
fs.writeFileSync(
|
||||||
|
changesetName,
|
||||||
|
`---
|
||||||
|
'@vercel/remix-builder': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Update \`@remix-run/dev\` fork to v${newVersion}
|
||||||
|
`
|
||||||
|
);
|
||||||
|
|
||||||
execSync(`git checkout -b ${branch}`);
|
execSync(`git checkout -b ${branch}`);
|
||||||
execSync('git add -A');
|
execSync('git add -A');
|
||||||
execSync(`git commit -m ${branch}`);
|
execSync(`git commit -m ${branch}`);
|
||||||
@@ -54,8 +66,8 @@ module.exports = async ({ github, context }, newVersion) => {
|
|||||||
repo,
|
repo,
|
||||||
head: branch,
|
head: branch,
|
||||||
base: 'main',
|
base: 'main',
|
||||||
title: `[remix] Upgrade @remix-run/dev to version ${newVersion}`,
|
title: `[remix] Update \`@remix-run/dev\` to v${newVersion}`,
|
||||||
body: `This auto-generated PR updates @remix-run/dev to version ${newVersion}`,
|
body: `This auto-generated PR updates \`@remix-run/dev\` to version ${newVersion}.`,
|
||||||
});
|
});
|
||||||
|
|
||||||
await github.rest.issues.addLabels({
|
await github.rest.issues.addLabels({
|
||||||
|
|||||||
Reference in New Issue
Block a user