Skip to content

Commit 9fee8c9

Browse files
authored
Update cp_dispatch.yml
1 parent 0831022 commit 9fee8c9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/cp_dispatch.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ on:
1414
options:
1515
- Windows (x86_64)
1616
- Linux (x86_64)
17+
patch-server-port:
18+
description: 'Patch server port (useful for resolving port conflicts)"'
19+
required: true
20+
default: '5678'
1721

1822
env:
1923
OS_ARCH: ${{ github.event.inputs.os-and-arch }}
2024
VERSION_TO_PATCH: ${{ github.event.inputs.version_to_patch }}
25+
PATCH_SERVER_PORT: ${{ github.event.inputs.patch-server-port }}
2126

2227
jobs:
2328

@@ -462,6 +467,19 @@ jobs:
462467
}
463468
shell: pwsh
464469

470+
- name: Set patch server port (in main.js of server)
471+
run: |
472+
$source_index = "msojocs-patch/server/index.js"
473+
$index_content = Get-Content -Path $source_index -Raw
474+
475+
if (Test-Path $source_index) {
476+
$index_content = $index_content -replace 'const port = \d+;', "const port = $env:PATCH_SERVER_PORT;"
477+
Set-Content -Path $source_index -Value $index_content
478+
Write-Host "Server port set to $env:PATCH_SERVER_PORT"
479+
} else {
480+
Write-Host "index.js (from server) not found"
481+
}
482+
465483
- name: Patch main.js to main.original.js
466484
run: |
467485
$source_main = "FE/resources/app/out/main.js"

0 commit comments

Comments
 (0)