Skip to content

Commit 276f61e

Browse files
📝[Enhancement]: Update workflow to use PowerShell shell and load dynamic environment variables; remove obsolete PSModule configuration files.
1 parent e211007 commit 276f61e

File tree

4 files changed

+29
-52
lines changed

4 files changed

+29
-52
lines changed

.github/workflows/workflow.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ permissions:
7070
pages: write # to deploy to Pages
7171
id-token: write # to verify the deployment originates from an appropriate source
7272

73+
defaults:
74+
run:
75+
shell: pwsh
76+
7377
jobs:
7478
# Runs on:
7579
# - ✅ Open/Updated PR - Always runs to load configuration
@@ -105,17 +109,25 @@ jobs:
105109
persist-credentials: false
106110
fetch-depth: 0
107111

112+
- name: Load dynamic envs
113+
env:
114+
RAW_JSON: ${{ fromJson(needs.Get-Settings.outputs.Settings).Linter.env }}
115+
run: |
116+
$map = $env:RAW_JSON | ConvertFrom-Json -AsHashtable
117+
118+
foreach ($key in $map.Keys) {
119+
$value = $map[$key]
120+
121+
Write-Host "$key = $value"
122+
123+
# Persist for following steps in this job
124+
"$key=$value" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
125+
}
126+
108127
- name: Lint code base
109128
uses: super-linter/super-linter@7bba2eeb89d01dc9bfd93c497477a57e72c83240 # v8.2.0
110129
env:
111-
GITHUB_TOKEN: ${{ github.token }}
112-
VALIDATE_BIOME_FORMAT: false
113-
VALIDATE_BIOME_LINT: false
114-
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false
115-
VALIDATE_JSCPD: false
116-
VALIDATE_JSON_PRETTIER: false
117-
VALIDATE_MARKDOWN_PRETTIER: false
118-
VALIDATE_YAML_PRETTIER: false
130+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119131

120132
# Runs on:
121133
# - ✅ Open/Updated PR - Builds module for testing

tests/srcWithManifestTestRepo/.github/PSModule.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

tests/srcWithManifestTestRepo/.github/PSModule.psd1

Lines changed: 0 additions & 22 deletions
This file was deleted.

tests/srcWithManifestTestRepo/.github/PSModule.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,12 @@ Test:
1111
PercentTarget: 1
1212
Publish:
1313
AutoCleanup: false
14+
Linter:
15+
env:
16+
VALIDATE_BIOME_FORMAT: false
17+
VALIDATE_BIOME_LINT: false
18+
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false
19+
VALIDATE_JSCPD: false
20+
VALIDATE_JSON_PRETTIER: false
21+
VALIDATE_MARKDOWN_PRETTIER: false
22+
VALIDATE_YAML_PRETTIER: false

0 commit comments

Comments
 (0)