Skip to content

Commit a98304b

Browse files
authored
set-output -> GITHUB_OUTPUT (#48)
1 parent 294b4b6 commit a98304b

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

.github/workflows/ci-vanilla.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
id: terraform-version-check
9191
run: |
9292
$terraformVersion = (Get-Content .terraform-version)
93-
Write-Output "::set-output name=TERRAFORM_VERSION::${terraformVersion}"
93+
Write-Output "TERRAFORM_VERSION=${terraformVersion}" >> $env:GITHUB_OUTPUT
9494
shell: pwsh
9595
- name: Use Terraform
9696
uses: hashicorp/setup-terraform@v1
@@ -146,7 +146,7 @@ jobs:
146146
$terraformOutput = (terraform output -json | ConvertFrom-Json -AsHashtable)
147147
foreach ($key in $terraformOutput.Keys) {
148148
$outputVariableValue = $terraformOutput[$key].value
149-
Write-Output "::set-output name=${key}::${outputVariableValue}"
149+
Write-Output "${key}=${outputVariableValue}" >> $env:GITHUB_OUTPUT
150150
Write-Output "TF_OUT_${key}=${outputVariableValue}" >> $env:GITHUB_ENV
151151
}
152152
shell: pwsh

scripts/create_workflow_strategy.ps1

+6-5
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,15 @@ function Parse-Strategy (
8888
$destroy = (Parse-Boolean -InputText $DestroyInput)
8989

9090
$preferredTerraformVersion = (Get-Content $PSScriptRoot/../terraform/.terraform-version | Out-String) -replace "`n|`r"
91-
Write-Output "::set-output name=terraform_preferred_version::${preferredTerraformVersion}"
91+
Write-Output "terraform_preferred_version=${preferredTerraformVersion}" >> $env:GITHUB_OUTPUT
92+
9293
$latestTerraformVersion = (Invoke-WebRequest -Uri https://checkpoint-api.hashicorp.com/v1/check/terraform -UseBasicParsing | Select-Object -ExpandProperty Content | ConvertFrom-Json | Select-Object -ExpandProperty "current_version")
93-
Write-Output "::set-output name=terraform_latest_version::${latestTerraformVersion}"
94+
Write-Output "terraform_latest_version=${latestTerraformVersion}" >> $env:GITHUB_OUTPUT
9495

9596
$installedAzureCLIVersion = $(az version --query '\"azure-cli\"' -o tsv)
96-
Write-Output "::set-output name=azure_cli_installed_version::${installedAzureCLIVersion}"
97+
Write-Output "azure_cli_installed_version=${installedAzureCLIVersion}" >> $env:GITHUB_OUTPUT
9798
$latestAzureCLIVersion = (Invoke-WebRequest -Uri https://api.github.com/repos/Azure/azure-cli/releases/latest -UseBasicParsing | Select-Object -ExpandProperty Content | ConvertFrom-Json | Select-Object -ExpandProperty "name").split(" ")[-1]
98-
Write-Output "::set-output name=azure_cli_latest_version::${latestAzureCLIVersion}"
99+
Write-Output "azure_cli_latest_version=${latestAzureCLIVersion}" >> $env:GITHUB_OUTPUT
99100

100101
$matrixJSONTemplate = $(Get-Content $PSScriptRoot/../.github/workflows/ci-scripted-strategy.json)
101102
$matrixObject = ($matrixJSONTemplate | ConvertFrom-Json)
@@ -134,4 +135,4 @@ if (($matrixObject.include[0].pin_provider_versions -eq $matrixObject.include[1]
134135
Write-Debug ($matrixObject | ConvertTo-Json)
135136
$matrixJSON = ($matrixObject | ConvertTo-Json -Compress)
136137

137-
Write-Output "::set-output name=matrix::${matrixJSON}"
138+
Write-Output "matrix=${matrixJSON}" >> $env:GITHUB_OUTPUT

scripts/deploy.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ try {
168168
$terraformOutput = (terraform output -json | ConvertFrom-Json -AsHashtable)
169169
foreach ($key in $terraformOutput.Keys) {
170170
$outputVariableValue = $terraformOutput[$key].value
171-
Write-Output "::set-output name=${key}::${outputVariableValue}"
171+
Write-Output "${key}=${outputVariableValue}" >> $env:GITHUB_OUTPUT
172172
Write-Output "TF_OUT_${key}=${outputVariableValue}" >> $env:GITHUB_ENV
173173
}
174174
}

0 commit comments

Comments
 (0)