-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor GitHub Actions workflow for PowerShell script validation and…
… update TODO comment in myvms.ps1
- Loading branch information
Showing
2 changed files
with
10 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,18 @@ | ||
| # .github/workflows/validate.yml | ||
| name: Validate PowerShell Scripts | ||
| name: PSScriptAnalyzer | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - "scripts/**/*.ps1" | ||
| - ".github/workflows/validate.yml" | ||
| pull_request: | ||
| paths: | ||
| - "scripts/**/*.ps1" | ||
| - ".github/workflows/validate.yml" | ||
|
|
||
| jobs: | ||
| validate: | ||
| runs-on: ubuntu-latest | ||
| analyze: | ||
| runs-on: ubuntu-latest # required host runner | ||
| container: | ||
| image: gossin/secsrv-cicd:2112 # your full environment is here | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| - name: Checkout repo # needed so the container sees your scripts | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install PSScriptAnalyzer | ||
| shell: pwsh | ||
| run: | | ||
| Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted | ||
| Install-Module PSScriptAnalyzer -Scope CurrentUser -Force -SkipPublisherCheck | ||
| - name: Run ScriptAnalyzer | ||
| shell: pwsh | ||
| run: | | ||
| Invoke-ScriptAnalyzer -EnableExit scripts/*.ps1 | ||
| - name: Run ScriptAnalyzer on all PowerShell files | ||
| run: pwsh -Command "Invoke-ScriptAnalyzer -Path . -Recurse -EnableExit" |
This file contains 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