Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running PSScriptAnalyzer as local action. #1388

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

spetersenms
Copy link

We are currently running PSScriptAnalyzer via the action in this repo: https://github.com/microsoft/psscriptanalyzer-action, however this has more settings and options than we need.
I recreated the action locally, and simplified it to fit our needs.

@Copilot Copilot bot review requested due to automatic review settings January 10, 2025 13:38
@spetersenms spetersenms requested a review from a team as a code owner January 10, 2025 13:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Actions/PSScriptAnalyzer/action.yml Outdated Show resolved Hide resolved
Actions/PSScriptAnalyzer/action.yml Outdated Show resolved Hide resolved
Actions/PSScriptAnalyzer/README.md Outdated Show resolved Hide resolved
@spetersenms
Copy link
Author

@microsoft-github-policy-service agree company="Microsoft"

aholstrup1
aholstrup1 previously approved these changes Jan 14, 2025
mazhelez
mazhelez previously approved these changes Jan 14, 2025
Copy link
Collaborator

@mazhelez mazhelez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great first addition! Left some comments, but otherwise, let's merge it!

Actions/PSScriptAnalyzer/README.md Outdated Show resolved Hide resolved
Actions/PSScriptAnalyzer/action.yml Outdated Show resolved Hide resolved
aholstrup1
aholstrup1 previously approved these changes Jan 16, 2025
Actions/RunPSScriptAnalyzer/RunPSScriptAnalyzer.ps1 Outdated Show resolved Hide resolved
aholstrup1
aholstrup1 previously approved these changes Jan 17, 2025

$htPSA = [ordered]@{ Path = $Path }
Write-Output "Modules installed, now running tests."
if (![string]::IsNullOrEmpty($ExcludeRule)) { $htPSA.add('ExcludeRule', $ExcludeRule) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (![string]::IsNullOrEmpty($ExcludeRule)) { $htPSA.add('ExcludeRule', $ExcludeRule) }
if ($ExcludeRule) { $htPSA.add('ExcludeRule', $ExcludeRule) }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants