refactor(devtools): update DevTools release script to resolve origin URL (#64062)

`git config` only lists the configured value, but `git remote get-url` actually resolves the URL and is more stable.

I had a local configuration which aliased `gh:` to the appropriate GitHub URL:

```
[url "git@github.com:"]
    insteadOf = "gh:"
    pushInsteadOf = "git@github.com"
```

In this scenario, `git config` returns `gh:dgp1130/angular`, but `git remote get-url` returns `git@github.com:dgp1130/angular`, which is what the subsequent regex expects.

PR Close #64062
This commit is contained in:
Doug Parker
2025-09-24 13:43:34 -07:00
committed by kirjs
parent 95fa943b20
commit e9b6ceb14d
+1 -1
View File
@@ -298,7 +298,7 @@ async function prepareReleasePullRequest(newVersion: string): Promise<void> {
await exec(`git push origin ${releaseBranch} --force-with-lease`);
console.log(chalk.green('Release branch pushed to your fork.'));
const {stdout: remoteUrl} = await exec('git config --get remote.origin.url');
const {stdout: remoteUrl} = await exec('git remote get-url origin');
const match = remoteUrl.trim().match(/github\.com[/:]([\w-]+)\/angular/);
const origin = match ? match[1] : 'angular';