Skip to content

Commit 380511a

Browse files
committed
(#134) Remove jq from pipelines
Closes #134
1 parent ab37d49 commit 380511a

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

.github/workflows/composite/deployment_type/action.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,28 @@ runs:
1919
2020
# If no string is provided, assume "all" and set everything to false
2121
if ([string]::IsNullOrWhiteSpace($deployment_type)) {
22-
"You must provide a deployment type to proceed."
23-
exit 1
22+
Write-Host "You must provide a deployment type to proceed."
23+
exit 1
2424
}
2525
26-
# First, set all options to false in case a previous run messed with them
27-
jq '.Options |= with_entries(.value = false)' akumina.sitedeployer.config.json > tmpfile
28-
Move-Item -Path tmpfile -Destination akumina.sitedeployer.config.json -Force
29-
26+
# Read and parse the JSON file
27+
$jsonPath = "akumina.sitedeployer.config.json"
28+
$json = Get-Content -Raw -Path $jsonPath | ConvertFrom-Json
29+
30+
# Set all options to false
31+
$json.Options.PSObject.Properties | ForEach-Object { $_.Value = $false }
32+
3033
# Split the input on commas and update the JSON file accordingly
3134
$deployment_types = $deployment_type -split ","
3235
foreach ($dt in $deployment_types) {
33-
jq --arg dt $dt '.Options[$dt] = true' akumina.sitedeployer.config.json > tmpfile
34-
Move-Item -Path tmpfile -Destination akumina.sitedeployer.config.json -Force
36+
if ($json.Options.PSObject.Properties.Name -contains $dt) {
37+
$json.Options.$dt = $true
38+
} else {
39+
Write-Host "Warning: Deployment type '$dt' not found in JSON options."
40+
}
3541
}
42+
43+
# Save the updated JSON (preserving formatting)
44+
$json | ConvertTo-Json -Depth 10 | Set-Content -Path $jsonPath -Encoding UTF8
3645
env:
3746
DEPLOYMENT_TYPE: ${{ inputs.deployment_type }}

.github/workflows/composite/setup/action.yml

-10
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@ runs:
55
using: "composite"
66
steps:
77

8-
- name: Install jq
9-
working-directory: site
10-
shell: pwsh
11-
run: |
12-
Invoke-WebRequest -Uri "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-win64.exe" -OutFile "jq.exe"
13-
New-Item -ItemType Directory -Force $env:USERPROFILE\Documents\PowerShell
14-
New-Item -ItemType File -Force $env:USERPROFILE\Documents\PowerShell\profile.ps1
15-
Add-Content $Profile.CurrentUserAllHosts 'Set-Alias jq "${pwd}\jq.exe"'
16-
178
- name: Setup Node
189
uses: actions/setup-node@v4
1910
with:
@@ -26,7 +17,6 @@ runs:
2617
shell: pwsh
2718
run: npm ci
2819

29-
# Temporarily using v1506 from the wiki while we wait for them to add the release
3020
- name: Install Akumina SiteDeployer
3121
working-directory: site
3222
shell: pwsh

0 commit comments

Comments
 (0)