chore(deps): bump zensical from 0.0.40 to 0.0.41 #37
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # CI workflow for ADPermissionsAnalyzer (Invoke-Build) | |
| # | |
| # Triggers on pull_request to main only — no push triggers. | |
| # PR trigger gates merging; push-to-dev and push-to-main are redundant. | |
| # | |
| # Secret scanning defense layers: | |
| # 1. Pre-commit hook (first defense) — .pre-commit-config.yaml | |
| # 2. CI TruffleHog scan (backstop) — secret-scan job below | |
| # | |
| # Jobs: changes → lint → test → secret-scan → ci-gate | |
| # Note: no docs-check job — this is a standalone script project, not a PlatyPS module. | |
| # Note: no bicep-validate job — no IaC in scope. | |
| name: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| changes: | |
| name: Detect Changes | |
| if: github.actor != 'claude[bot]' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| outputs: | |
| powershell: ${{ steps.filter.outputs.powershell }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| powershell: | |
| - '**/*.ps1' | |
| - '**/*.psd1' | |
| - 'PSScriptAnalyzerSettings.psd1' | |
| - '*.build.ps1' | |
| - 'build.config.psd1' | |
| - '.github/workflows/ci.yml' | |
| lint: | |
| name: PSScriptAnalyzer | |
| needs: changes | |
| if: github.actor != 'claude[bot]' && needs.changes.outputs.powershell == 'true' | |
| runs-on: ubuntu-latest | |
| # Lint runs PSScriptAnalyzer (AST-only, no module import) — ubuntu is fine. | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Get cache week | |
| id: week | |
| run: echo "week=$(date +%Y-W%V)" >> $GITHUB_OUTPUT | |
| - name: Cache PowerShell modules | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.local/share/powershell/Modules | |
| key: ps-lint-${{ steps.week.outputs.week }}-${{ hashFiles('.github/workflows/ci.yml') }} | |
| restore-keys: | | |
| ps-lint- | |
| - name: Install build dependencies | |
| shell: pwsh | |
| run: | | |
| foreach ($mod in @('InvokeBuild', 'PSScriptAnalyzer')) { | |
| if (-not (Get-Module -ListAvailable -Name $mod)) { | |
| Install-Module -Name $mod -Force -Scope CurrentUser | |
| } | |
| } | |
| - name: Run lint | |
| shell: pwsh | |
| run: Invoke-Build Lint | |
| test: | |
| name: Pester Tests | |
| needs: changes | |
| if: github.actor != 'claude[bot]' && needs.changes.outputs.powershell == 'true' | |
| runs-on: windows-latest | |
| # Windows runner required: System.DirectoryServices.ActiveDirectorySecurity | |
| # (used for ACE parsing) is Windows-only on .NET 5+. | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| checks: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Get cache week | |
| id: week | |
| shell: pwsh | |
| run: | | |
| $week = (Get-Date -UFormat '%Y-W%V') | |
| "week=$week" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| - name: Cache PowerShell modules | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/Documents/PowerShell/Modules | |
| key: ps-test-${{ steps.week.outputs.week }}-${{ hashFiles('.github/workflows/ci.yml') }} | |
| restore-keys: | | |
| ps-test- | |
| - name: Install build dependencies | |
| shell: pwsh | |
| run: | | |
| foreach ($mod in @( | |
| @{ Name = 'InvokeBuild' }, | |
| @{ Name = 'Pester'; MinimumVersion = '5.0.0' } | |
| )) { | |
| if (-not (Get-Module -ListAvailable -Name $mod.Name)) { | |
| $installParams = @{ | |
| Name = $mod.Name | |
| Force = $true | |
| Scope = 'CurrentUser' | |
| } | |
| if ($mod.MinimumVersion) { $installParams.MinimumVersion = $mod.MinimumVersion } | |
| Install-Module @installParams | |
| } | |
| } | |
| - name: Run tests | |
| shell: pwsh | |
| run: Invoke-Build Test -Configuration Release | |
| - name: Publish test results | |
| if: always() && hashFiles('TestResults.xml') != '' | |
| uses: dorny/test-reporter@v3 | |
| with: | |
| name: Pester Tests | |
| path: TestResults.xml | |
| reporter: java-junit | |
| - name: Upload test results | |
| if: always() && hashFiles('TestResults.xml') != '' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: test-results | |
| path: TestResults.xml | |
| - name: Upload coverage results | |
| if: always() && hashFiles('CoverageResults.xml') != '' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-results | |
| path: CoverageResults.xml | |
| secret-scan: | |
| name: Secret Scan | |
| if: github.actor != 'claude[bot]' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: TruffleHog scan | |
| uses: trufflesecurity/trufflehog@main | |
| with: | |
| extra_args: --only-verified | |
| ci-gate: | |
| name: CI Gate | |
| if: always() && github.actor != 'claude[bot]' | |
| needs: [lint, test, secret-scan] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Check job results | |
| run: | | |
| if [[ "${{ needs.lint.result }}" == "failure" || \ | |
| "${{ needs.test.result }}" == "failure" || \ | |
| "${{ needs.secret-scan.result }}" == "failure" ]]; then | |
| echo "One or more CI jobs failed" | |
| exit 1 | |
| fi | |
| echo "All CI jobs passed or were skipped" |