Skip to content

Commit 90268fe

Browse files
Fix timeout command and targeting branch bugs in upd-xna-client.yml
1 parent 241b1c3 commit 90268fe

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/upd-xna-client.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
env:
1515
CLIENT_PATH: ClientFiles # Do not add trailing slash
1616
UPDATE_BRANCH_NAME: update-client-binaries # The workflow adds the release tag after this value, i.e. "update-client-binaries-2.12.13"
17+
TARGET_BRANCH: master # Into this branch workflow should create pull request for merge
1718
COMMIT_MESSAGE: Update client binaries to the latest version
1819
PR_TITLE: Update client binaries to the version # The workflow adds the release tag after this value, i.e. "Update client binaries to the version 2.12.13"
1920
PR_BODY: This is an automatic pull request to update client binaries to the latest release published in [CnCNet/xna-cncnet-client](https://github.com/CnCNet/xna-cncnet-client) repository.
@@ -36,7 +37,7 @@ jobs:
3637
latest: true
3738
fileName: xna-cncnet-client*
3839

39-
- name: Open PR
40+
- name: Create Update Branch
4041
env:
4142
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4243
run: |
@@ -176,9 +177,15 @@ jobs:
176177
git push --force origin ${{ env.UPDATE_BRANCH_NAME }}-${{ steps.download.outputs.tag_name }}
177178
178179
# This timeout is for the remote server to index received content
179-
timeout /t 100 > nul
180+
# https://stackoverflow.com/questions/74842935/powershell-batch-script-timeout-error-input-redirection-is-not-supported-exiti
181+
Start-Job {
182+
# Simulate calling a batch file (cmd /c)
183+
# inside of which the `start` call is made,
184+
# waiting for 5 seconds in this example.
185+
cmd /c start /min timeout.exe 10
186+
} | Receive-Job -Wait -AutoRemoveJob
180187
181188
# Open a PR
182-
gh pr create -B main -H ${{ env.UPDATE_BRANCH_NAME }}-${{ steps.download.outputs.tag_name }} --title '${{ env.PR_TITLE }} ${{ steps.download.outputs.tag_name }}' --body '${{ env.PR_BODY }}'
189+
gh pr create -B ${{ env.TARGET_BRANCH }} -H ${{ env.UPDATE_BRANCH_NAME }}-${{ steps.download.outputs.tag_name }} --title '${{ env.PR_TITLE }} ${{ steps.download.outputs.tag_name }}' --body '${{ env.PR_BODY }}'
183190
}
184191
}

0 commit comments

Comments
 (0)