Skip to content

Commit ad33606

Browse files
committed
feat(update-vscode): add step to commit files
1 parent f19ae17 commit ad33606

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

ci/dev/update-vscode.sh

+19-5
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ main() {
3737

3838
echo -e "Great! We'll prep a PR for updating to $VSCODE_EXACT_VERSION\n"
3939

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+
4046
# Check if GitHub CLI is installed
4147
if ! command -v gh &> /dev/null; then
4248
echo "GitHub CLI could not be found."
@@ -55,14 +61,22 @@ main() {
5561
git push origin "$CURRENT_BRANCH"
5662
fi
5763

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-
6264
echo "Going to try to update vscode for you..."
6365
echo -e "Running: git subtree pull --prefix lib/vscode vscode release/${VSCODE_VERSION_TO_UPDATE} --squash\n"
6466
# 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
6680
}
6781

6882
main "$@"

0 commit comments

Comments
 (0)