Skip to content

Commit 4e20b09

Browse files
refactor: format TestData structure in workflow files for clarity
1 parent aecf28e commit 4e20b09

2 files changed

Lines changed: 16 additions & 20 deletions

File tree

.github/workflows/Workflow-Test-Default.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,15 @@ jobs:
2929
uses: ./.github/workflows/workflow.yml
3030
secrets:
3131
APIKey: ${{ secrets.APIKey }}
32-
# Self-test only: a dedicated, NON-SENSITIVE repository secret + variable exist purely to prove
33-
# the TestData plumbing end to end - the "secrets" entry is masked and the "variables" entry is
34-
# not, and both are exposed as $env:<name>. Their known values are asserted (value + length) in
35-
# tests/.../Environment.Tests.ps1.
36-
# Secrets use the direct "${{ secrets.X }}" form (CodeQL-clean; avoids toJSON(secrets.*)), which
37-
# requires single-line secret values with no embedded quotes or backslashes; variables use
38-
# toJSON(vars.X) so any characters are encoded safely. The folded '>-' scalar keeps the whole blob
39-
# on ONE line so GitHub registers a single mask instead of one per line.
4032
TestData: >-
41-
{ "secrets": { "PSMODULE_TEST_SINGLELINE_SECRET": "${{ secrets.PSMODULE_TEST_SINGLELINE_SECRET }}" },
42-
"variables": { "PSMODULE_TEST_VARIABLE": ${{ toJSON(vars.PSMODULE_TEST_VARIABLE) }} } }
33+
{
34+
"secrets": {
35+
"PSMODULE_TEST_SINGLELINE_SECRET": "${{ secrets.PSMODULE_TEST_SINGLELINE_SECRET }}"
36+
},
37+
"variables": {
38+
"PSMODULE_TEST_VARIABLE": ${{ toJSON(vars.PSMODULE_TEST_VARIABLE) }}
39+
}
40+
}
4341
with:
4442
WorkingDirectory: tests/srcTestRepo
4543
ImportantFilePatterns: |

.github/workflows/Workflow-Test-WithManifest.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,15 @@ jobs:
2929
uses: ./.github/workflows/workflow.yml
3030
secrets:
3131
APIKey: ${{ secrets.APIKey }}
32-
# Self-test only: a dedicated, NON-SENSITIVE repository secret + variable exist purely to prove
33-
# the TestData plumbing end to end - the "secrets" entry is masked and the "variables" entry is
34-
# not, and both are exposed as $env:<name>. Their known values are asserted (value + length) in
35-
# tests/.../Environment.Tests.ps1.
36-
# Secrets use the direct "${{ secrets.X }}" form (CodeQL-clean; avoids toJSON(secrets.*)), which
37-
# requires single-line secret values with no embedded quotes or backslashes; variables use
38-
# toJSON(vars.X) so any characters are encoded safely. The folded '>-' scalar keeps the whole blob
39-
# on ONE line so GitHub registers a single mask instead of one per line.
4032
TestData: >-
41-
{ "secrets": { "PSMODULE_TEST_SINGLELINE_SECRET": "${{ secrets.PSMODULE_TEST_SINGLELINE_SECRET }}" },
42-
"variables": { "PSMODULE_TEST_VARIABLE": ${{ toJSON(vars.PSMODULE_TEST_VARIABLE) }} } }
33+
{
34+
"secrets": {
35+
"PSMODULE_TEST_SINGLELINE_SECRET": "${{ secrets.PSMODULE_TEST_SINGLELINE_SECRET }}"
36+
},
37+
"variables": {
38+
"PSMODULE_TEST_VARIABLE": ${{ toJSON(vars.PSMODULE_TEST_VARIABLE) }}
39+
}
40+
}
4341
with:
4442
WorkingDirectory: tests/srcWithManifestTestRepo
4543
ImportantFilePatterns: |

0 commit comments

Comments
 (0)