Skip to content

Workflow-Test [Default] - [🚀 [Feature]: Modules can expose caller-selected secrets to test jobs via TestSecrets #365] by @MariusStorhaug #1621

Workflow-Test [Default] - [🚀 [Feature]: Modules can expose caller-selected secrets to test jobs via TestSecrets #365] by @MariusStorhaug

Workflow-Test [Default] - [🚀 [Feature]: Modules can expose caller-selected secrets to test jobs via TestSecrets #365] by @MariusStorhaug #1621

name: Workflow-Test [Default]
run-name: 'Workflow-Test [Default] - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}'
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/**'
- '!.github/workflows/Release.yml'
- '!.github/workflows/Linter.yml'
schedule:
- cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
statuses: write
pages: write
id-token: write
jobs:
WorkflowTestDefault:
uses: ./.github/workflows/workflow.yml
secrets:
APIKey: ${{ secrets.APIKey }}
# The calling workflow chooses which secrets to expose to the test jobs. Names are
# caller-defined and read by the module's Pester tests via $env:<name>. CUSTOM_TEST_ENV_VAR
# is a plain literal that proves arbitrary, caller-defined names flow through end to end.
# The folded '>-' block with flat indentation produces a SINGLE-LINE secret value; a literal
# '|' multi-line value makes GitHub register every line as its own mask and over-masks logs.
TestSecrets: >-
{
"TEST_APP_ENT_CLIENT_ID": ${{ toJSON(secrets.TEST_APP_ENT_CLIENT_ID) }},
"TEST_APP_ENT_PRIVATE_KEY": ${{ toJSON(secrets.TEST_APP_ENT_PRIVATE_KEY) }},
"TEST_APP_ORG_CLIENT_ID": ${{ toJSON(secrets.TEST_APP_ORG_CLIENT_ID) }},
"TEST_APP_ORG_PRIVATE_KEY": ${{ toJSON(secrets.TEST_APP_ORG_PRIVATE_KEY) }},
"TEST_USER_ORG_FG_PAT": ${{ toJSON(secrets.TEST_USER_ORG_FG_PAT) }},
"TEST_USER_USER_FG_PAT": ${{ toJSON(secrets.TEST_USER_USER_FG_PAT) }},
"TEST_USER_PAT": ${{ toJSON(secrets.TEST_USER_PAT) }},
"CUSTOM_TEST_ENV_VAR": "caller-provided-value"
}
with:
WorkingDirectory: tests/srcTestRepo
ImportantFilePatterns: |
^src/
^README\.md$
^\.github/workflows/(?!Release\.yml$|Linter\.yml$)