GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - devblackops/github-action-psscriptanalyzer: GitHub Action to run PSScriptAnalyzer static code analysis

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
BranchesTags
Open more actions menu

Latest commit

 

History

79 Commits
79 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
media
media
 
 
.gitattributes
.gitattributes
 
 
CHANGELOG.md
CHANGELOG.md
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
action.yml
action.yml
 
 
build.ps1
build.ps1
 
 
entrypoint.ps1
entrypoint.ps1
 
 
psakeFile.ps1
psakeFile.ps1
 
 

Repository files navigation

github-action-psscriptanalyzer

GitHub Actions Status

GitHub Action to run PSScriptAnalyzer static code analysis checks on PowerShell for Pull Requests.

Success Criteria

By default, this action will succeed if zero PSScriptAnalyzer errors and warnings are found. Failing on errors, warnings, or informational issues can be configured. See Usage below. The sending of comments back to the PR if the action fails can be disabled if desired.

Usage

Basic

Basic configuration that will run PSSA and fail on errors or warnings, and send a comment back to the PR with a summary. Note, that repoToken is required for sending comments back.

name: CI
on: [pull_request]
jobs:
  lint:
    name: Run PSSA
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: lint
      uses: devblackops/github-action-psscriptanalyzer@master
      with:
        repoToken: ${{ secrets.GITHUB_TOKEN }}

Advanced

Advanced configuration that will run PSSA only in the MyModule directory, with custom PSSA settings, and fail on errors, warnings, or informational issues. A comment back to the PR with the PSSA summary will also be sent if any issues were detected.

name: CI
on: [pull_request]
jobs:
  lint:
    name: Run PSSA
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: lint
      uses: devblackops/github-action-psscriptanalyzer@master
      with:
        rootPath: MyModule
        settingsPath: pssa_settings.psd1
        sendComment: true
        repoToken: ${{ secrets.GITHUB_TOKEN }}
        failOnErrors: true
        failOnWarnings: true
        failOnInfos: true

Docker

Use the Docker Hub version of the Action instead of building the container during the check.

name: CI
on: [pull_request]
jobs:
  lint:
    name: Run PSSA
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: lint
      uses: docker://devblackops/github-action-psscriptanalyzer:2.3.0
      with:
        repoToken: ${{ secrets.GITHUB_TOKEN }}

Inputs

Name Default Description
rootPath <none> The root directory to run PSScriptAnalyzer on. By default, this is the root of the repository.
settingsPath <none> The path to a PSScriptAnalyser settings file to control rules to execute.
sendComment true Enable/disable sending comments with PSScriptAnalyzer results back to PR.
repoToken <none> GitHub token the action will use to send comments back to PR with. Use ${{ secrets.GITHUB_TOKEN }}.
failOnErrors true Enable/disable failing the action on PSScriptAnalyzer error items.
failOnWarnings true Enable/disable failing the action on PSScriptAnalyzer warning items.
failOnInfos false Enable/disable failing the action on PSScriptAnalyzer informational items.

Example

About

GitHub Action to run PSScriptAnalyzer static code analysis

Topics

github-actionspowershellpsscriptanalyzer

Resources

Readme
MIT license
Activity

Stars

77 stars

Watchers

4 watching

Forks

12 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.