@samitouri / QOSAMI-WSL / commits / 763fcbec

Update localization and notice scripts to target the branch that the pipeline is running on (#14492)

Blue committed Mar 20, 2026 at 20:46 UTC 763fcbec3c0fc8e16ae9460237f2c9ebf671c636
3 files changed +15 -6
.pipelines/wsl-build-nightly-localization.yml
+6 -2
@@ -17,6 +17,9 @@ schedules:
17 - "master"
18 always: true
19
20 +variables:
21 + targetBranch: ${{ variables['Build.SourceBranchName'] }}
22 +
23 pool:
24 vmImage: 'windows-latest'
25
@@ -45,9 +48,10 @@ steps:
48
49 - powershell: |
50 pip install --user -r tools/devops/requirements.txt
48 - python tools/devops/create-change.py . "$env:token" "WSL localization" "Localization change from build: $env:buildId" "user/localization/$env:buildId"
51 + python tools/devops/create-change.py . "$env:token" "WSL localization" "Localization change from build: $env:buildId" "user/localization/$env:buildId" "$env:targetBranch"
52
53 displayName: Create pull request
54 env:
55 token: $(GithubPRToken)
53 - buildId: $(Build.BuildId)
\ No newline at end of file
56 + buildId: $(Build.BuildId)
57 + targetBranch: $(targetBranch)
\ No newline at end of file
.pipelines/wsl-build-notice.yml
+6 -2
@@ -3,6 +3,9 @@ trigger:
3 include:
4 - master
5
6 +variables:
7 + targetBranch: ${{ variables['Build.SourceBranchName'] }}
8 +
9 pool:
10 vmImage: 'windows-latest'
11
@@ -25,9 +28,10 @@ steps:
28
29 - powershell: |
30 pip install --user -r tools/devops/requirements.txt
28 - python tools/devops/create-change.py . "$env:token" "WSL notice" "Notice change from build: $env:buildId" "user/notice/$env:buildId"
31 + python tools/devops/create-change.py . "$env:token" "WSL notice" "Notice change from build: $env:buildId" "user/notice/$env:buildId" "$env:targetBranch"
32
33 displayName: Create pull request
34 env:
35 token: $(GithubPRToken)
33 - buildId: $(Build.BuildId)
\ No newline at end of file
36 + buildId: $(Build.BuildId)
37 + targetBranch: $(targetBranch)
\ No newline at end of file
tools/devops/create-change.py
+3 -2
@@ -12,8 +12,9 @@ REPO = 'microsoft/wsl'
12 @click.argument('committer', required=True)
13 @click.argument('message', required=True)
14 @click.argument('branch', required=True)
15 +@click.argument('target_branch', required=True)
16 @click.option('--debug', default=False, is_flag=True)
16 -def main(repo_path: str, token: str, committer: str, message: str, branch: str, debug: bool):
17 +def main(repo_path: str, token: str, committer: str, message: str, branch: str, target_branch: str, debug: bool):
18 try:
19 repo = Repo(repo_path)
20
@@ -41,7 +42,7 @@ def main(repo_path: str, token: str, committer: str, message: str, branch: str,
42 'title': message,
43 'description': 'Automated change',
44 'head': branch,
44 - 'base': 'master'
45 + 'base': target_branch
46 }
47
48 response = requests.post(f'https://api.github.com/repos/{REPO}/pulls', headers=headers, data=json.dumps(body), timeout=30)