Skip to content

Commit

Permalink
fix: Gracefully close process in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
AnimMouse committed Aug 30, 2023
1 parent d282b42 commit f3ec28d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
run: |
$http_server = Start-Process "python" "-m http.server 8080" -PassThru
Wait-Process $http_server.Id -Timeout 60 -ErrorAction Ignore
Stop-Process $http_server.Id
$http_server.CloseMainWindow()
Wait-Process $http_server.Id
- name: Shutdown cloudflared using setup-cloudflared/shutdown
Expand Down
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ runs:
with:
folder_name: cloudflared

- name: Sign in to Cloudflare Tunnel client on Unix-like
- name: Sign in to cloudflared on Unix-like
if: runner.os == 'Linux' || runner.os == 'macOS'
shell: bash
run: $GITHUB_ACTION_PATH/scripts/sign-in/Unix-like.sh
Expand All @@ -75,7 +75,7 @@ runs:
cloudflare_tunnel_configuration: ${{ inputs.cloudflare_tunnel_configuration }}
cloudflare_tunnel_id: ${{ inputs.cloudflare_tunnel_id }}

- name: Sign in to Cloudflare Tunnel client on Windows
- name: Sign in to cloudflared on Windows
if: runner.os == 'Windows'
shell: pwsh
run: '& $env:GITHUB_ACTION_PATH\scripts\sign-in\Windows.ps1'
Expand All @@ -84,12 +84,12 @@ runs:
cloudflare_tunnel_configuration: ${{ inputs.cloudflare_tunnel_configuration }}
cloudflare_tunnel_id: ${{ inputs.cloudflare_tunnel_id }}

- name: Start Cloudflare Tunnel in the background on Unix-like
- name: Start cloudflared in the background on Unix-like
if: (runner.os == 'Linux' || runner.os == 'macOS') && inputs.autostart != 'false'
shell: bash
run: $GITHUB_ACTION_PATH/scripts/autostart/Unix-like.sh

- name: Start Cloudflare Tunnel in the background on Windows
- name: Start cloudflared in the background on Windows
if: runner.os == 'Windows' && inputs.autostart != 'false'
shell: pwsh
run: '& $env:GITHUB_ACTION_PATH\scripts\autostart\Windows.ps1'
2 changes: 1 addition & 1 deletion shutdown/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ runs:
shell: pwsh
working-directory: ${{ runner.temp }}
run: |
Stop-Process $(Get-Content cloudflared.pid)
(Get-Process -Id $(Get-Content cloudflared.pid)).CloseMainWindow()
Wait-Process -Id $(Get-Content cloudflared.pid)
- name: View logs of cloudflared for Windows
Expand Down

0 comments on commit f3ec28d

Please sign in to comment.