Skip to content

Commit bf70b29

Browse files
🩹 [Patch]: Establish Settings as integration channel (#233)
This release refactors the internal GitHub Actions workflow architecture to improve maintainability and consistency. **No user-facing changes or breaking changes are included.** #### What Changed All major workflows (`Build-Docs.yml`, `Build-Module.yml`, `Build-Site.yml`, `Get-CodeCoverage.yml`) have been refactored to use a unified configuration approach: - **Unified Configuration**: Workflows now accept a single `Settings` JSON object instead of multiple individual parameters, reducing complexity and potential configuration errors - **Streamlined Access Patterns**: All workflow steps and environment variables now extract values from the centralized `Settings` object using `fromJson` - **Code Maintenance**: Removed redundant output definitions from the `Get-Settings.yml` workflow - **Consistency**: Standardized configuration access patterns across all workflows #### Technical Details This is a purely internal refactoring focused on improving the workflow infrastructure. The changes make future workflow modifications easier to implement and maintain while ensuring consistency across the entire automation pipeline.
1 parent 3dcca81 commit bf70b29

33 files changed

+896
-1936
lines changed

.github/copilot-instructions.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
## Terminal Commands
44

5-
When executing terminal commands (using `run_in_terminal` or similar tools):
6-
75
- Prefer MCP server calls over command-line tools when possible.
8-
- **ALWAYS** send commands into `pwsh -Command` to ensure proper execution.
9-
- These commands must be enclosed in single quotes.
10-
- Escape any single quotes within the command by doubling them (e.g., `It's` becomes `It''s`).
11-
- Use double quotes for string with variables or expressions inside the single-quoted command.
6+
- When running scripts within the [scripts](../.specify/scripts/) folder, just run them directly (shell is default PowerShell).
7+
- For other commands, send them into `pwsh -Command` to ensure proper execution.
8+
9+
### Quoting in PowerShell
10+
11+
Proper quoting is essential in PowerShell to prevent parsing errors and ensure correct command execution.
12+
13+
- **Direct script execution**: Scripts run directly in PowerShell use standard PowerShell quoting rules. Double quotes expand variables and expressions, while single quotes are literal. No additional shell escaping is needed.
14+
15+
- **Via `pwsh -Command`**: Commands are passed as strings to PowerShell. Enclose the entire command in single quotes to treat it as a literal string. Escape single quotes within the command by doubling them (e.g., `It's` becomes `It''s`). Use double quotes within the command for variable expansion, but ensure the outer single quotes protect the string from shell interpretation.
1216

13-
## Other instructions
17+
For arguments containing single quotes, prefer double-quoting the argument inside the command string.
1418

15-
| Tech | Instruction file |
16-
|------------|-------------------------------------------------------------|
17-
| PowerShell | [pwsh.instructions.md](./instructions/pwsh.instructions.md) |
18-
| Markdown | [md.instructions.md](./instructions/md.instructions.md) |
19+
Example: `pwsh -Command 'Write-Host "I''m Groot"'`
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: AfterAll-ModuleLocal
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
Settings:
7+
type: string
8+
description: The complete settings object including test suites.
9+
required: true
10+
11+
permissions:
12+
contents: read # to checkout the repo
13+
14+
jobs:
15+
AfterAll-ModuleLocal:
16+
name: AfterAll-ModuleLocal
17+
runs-on: ubuntu-latest
18+
env:
19+
SETTINGS: ${{ inputs.Settings }}
20+
steps:
21+
- name: Checkout Code
22+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
23+
with:
24+
persist-credentials: false
25+
fetch-depth: 0
26+
27+
- name: Run AfterAll Teardown Scripts
28+
if: always()
29+
uses: PSModule/GitHub-Script@8b9d2739d6896975c0e5448d2021ae2b94b6766a # v1.7.6
30+
with:
31+
Name: AfterAll-ModuleLocal
32+
ShowInfo: false
33+
ShowOutput: true
34+
Debug: ${{ fromJson(inputs.Settings).Debug }}
35+
Prerelease: ${{ fromJson(inputs.Settings).Prerelease }}
36+
Verbose: ${{ fromJson(inputs.Settings).Verbose }}
37+
Version: ${{ fromJson(inputs.Settings).Version }}
38+
WorkingDirectory: ${{ fromJson(inputs.Settings).WorkingDirectory }}
39+
Script: |
40+
LogGroup "Running AfterAll Teardown Scripts" {
41+
$afterAllScript = 'tests/AfterAll.ps1'
42+
43+
if (-not (Test-Path $afterAllScript)) {
44+
Write-Host "No AfterAll.ps1 script found at [$afterAllScript] - exiting successfully"
45+
exit 0
46+
}
47+
48+
Write-Host "Running AfterAll teardown script: $afterAllScript"
49+
try {
50+
& $afterAllScript
51+
Write-Host "AfterAll script completed successfully: $afterAllScript"
52+
} catch {
53+
Write-Warning "AfterAll script failed: $afterAllScript - $_"
54+
# Don't throw for teardown scripts to ensure other cleanup scripts can run
55+
}
56+
}

0 commit comments

Comments
 (0)