@@ -37,6 +37,12 @@ main() {
37
37
38
38
echo -e " Great! We'll prep a PR for updating to $VSCODE_EXACT_VERSION \n"
39
39
40
+ # For some reason the subtree update doesn't work
41
+ # unless we fetch all the branches
42
+ echo -e " Fetching vscode branches..."
43
+ echo -e " Note: this might take a while"
44
+ git fetch vscode
45
+
40
46
# Check if GitHub CLI is installed
41
47
if ! command -v gh & > /dev/null; then
42
48
echo " GitHub CLI could not be found."
@@ -55,14 +61,22 @@ main() {
55
61
git push origin " $CURRENT_BRANCH "
56
62
fi
57
63
58
- echo " Opening a draft PR on GitHub"
59
- # To read about these flags, visit the docs: https://cli.github.com/manual/gh_pr_create
60
- gh pr create --base master --title " feat(vscode): update to version $VSCODE_EXACT_VERSION " --body " This PR updates vscode to version: $VSCODE_EXACT_VERSION " --reviewer @cdr/code-server-reviewers --repo cdr/code-server --draft
61
-
62
64
echo " Going to try to update vscode for you..."
63
65
echo -e " Running: git subtree pull --prefix lib/vscode vscode release/${VSCODE_VERSION_TO_UPDATE} --squash\n"
64
66
# Try to run subtree update command
65
- git subtree pull --prefix lib/vscode vscode release/" ${VSCODE_VERSION_TO_UPDATE} " --squash --message " chore(vscode): update to $VSCODE_VERSION_TO_UPDATE "
67
+ git subtree pull --prefix lib/vscode vscode release/" ${VSCODE_VERSION_TO_UPDATE} " --squash --message " chore(vscode): update to $VSCODE_EXACT_VERSION "
68
+
69
+ echo " Forcing a commit with conflicts"
70
+ echo " Note: this is intentional"
71
+ echo " If we don't do this, code review is impossible."
72
+ echo " For more info, see docs: docs/CONTRIBUTING.md#updating-vs-code"
73
+ git add . && git commit -am " chore(vscode): commit conflicts from $VSCODE_EXACT_VERSION update"
74
+
75
+ # Note: we can't open a draft PR unless their are changes.
76
+ # Hence why we do this after the subtree update.
77
+ echo " Opening a draft PR on GitHub"
78
+ # To read about these flags, visit the docs: https://cli.github.com/manual/gh_pr_create
79
+ gh pr create --base master --title " feat(vscode): update to version $VSCODE_EXACT_VERSION " --body " This PR updates vscode to version: $VSCODE_EXACT_VERSION " --reviewer @cdr/code-server-reviewers --repo cdr/code-server --draft
66
80
}
67
81
68
82
main " $@ "
0 commit comments