Repository navigation
Align shared Copilot repository templates #112
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
| name: CI | |
| on: [push, pull_request, workflow_dispatch] | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Validate with Windows PowerShell 5.1 | |
| shell: powershell | |
| run: | | |
| $ErrorActionPreference = 'Stop' | |
| if (-not (Get-PSRepository -Name PSGallery -ErrorAction SilentlyContinue)) { | |
| Register-PSRepository -Default | |
| } | |
| Install-Module Pester -RequiredVersion '6.2.0' -Repository PSGallery -Scope CurrentUser -Force | |
| Install-Module PSScriptAnalyzer -RequiredVersion '1.25.0' -Repository PSGallery -Scope CurrentUser -Force | |
| Import-Module Pester -RequiredVersion '6.2.0' -Force | |
| Import-Module PSScriptAnalyzer -RequiredVersion '1.25.0' -Force | |
| $ValidationParameters = @{} | |
| if ($env:GITHUB_REF -like 'refs/tags/*') { | |
| $ValidationParameters.Tag = $env:GITHUB_REF.Substring('refs/tags/'.Length) | |
| } | |
| .\build\Invoke-Validation.ps1 @ValidationParameters |