File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
modules/runners/templates Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change 11# # install the runner
22
33Write-Host " Creating actions-runner directory for the GH Action installation"
4- New-Item - ItemType Directory - Path C:\actions- runner ; Set-Location C:\actions- runner
4+ New-Item - ItemType Directory - Path C:\actions- runner - Force | Out-Null
5+ Set-Location C:\actions- runner
56
6- Write-Host " Downloading the GH Action runner from s3 bucket $s3_location "
7- aws s3 cp ${S3_LOCATION_RUNNER_DISTRIBUTION} actions- runner.zip
7+ $runnerTarballUrl = $Env: RUNNER_TARBALL_URL
8+ $s3RunnerDistribution = $Env: S3_LOCATION_RUNNER_DISTRIBUTION
9+
10+ if ([string ]::IsNullOrWhiteSpace($runnerTarballUrl ) -and [string ]::IsNullOrWhiteSpace($s3RunnerDistribution )) {
11+ Write-Host " Neither RUNNER_TARBALL_URL nor S3_LOCATION_RUNNER_DISTRIBUTION are set" - ForegroundColor Red
12+ exit 1
13+ }
14+
15+ $fileName = " actions-runner.zip"
16+
17+ if (-not [string ]::IsNullOrWhiteSpace($runnerTarballUrl )) {
18+ Write-Host " Downloading the GH Action runner from $runnerTarballUrl to $fileName "
19+ Invoke-WebRequest - Uri $runnerTarballUrl - OutFile $fileName - UseBasicParsing
20+ }
21+ else {
22+ Write-Host " Downloading the GH Action runner from s3 bucket $s3RunnerDistribution "
23+ aws s3 cp $s3RunnerDistribution $fileName | Out-Null
24+ }
825
926Write-Host " Un-zip action runner"
1027Expand-Archive - Path actions- runner.zip - DestinationPath .
You can’t perform that action at this time.
0 commit comments