Skip to content

🔄 Sync with @Andrews-McMeel-Universal/action_template #1

🔄 Sync with @Andrews-McMeel-Universal/action_template

🔄 Sync with @Andrews-McMeel-Universal/action_template #1

Workflow file for this run

name: PR Checks
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
application-ci:
name: Install and run PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install PSScriptAnalyzer module
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module PSScriptAnalyzer -ErrorAction Stop
- name: Lint with PSScriptAnalyzer
shell: pwsh
run: |
Invoke-ScriptAnalyzer -Path *.ps1 -Recurse -Outvariable issues
$errors = $issues.Where({$_.Severity -eq 'Error'})
$warnings = $issues.Where({$_.Severity -eq 'Warning'})
if ($errors) {
Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop
} else {
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total."
}
pr-labels:
if: ${{ github.actor != 'dependabot[bot]' }}
name: PR Labels
uses: Andrews-McMeel-Universal/reusable_workflows/.github/workflows/pr-labels.yaml@2
secrets:
PAT_ACTION_CI: ${{ secrets.PAT_ACTION_CI }}
codeowners-validation:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Codeowners File Validation
uses: Andrews-McMeel-Universal/reusable_workflows/.github/workflows/codeowners-validation.yaml@2
jira-lint:
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'amutechtest' && github.ref != 'refs/heads/development' && github.ref != 'refs/heads/main' }}
name: Jira PR Linter
uses: Andrews-McMeel-Universal/reusable_workflows/.github/workflows/jira-lint.yaml@2
with:
fail-on-error: false
skip-comments: true
secrets:
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
lint:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Simple Lint
uses: Andrews-McMeel-Universal/reusable_workflows/.github/workflows/simple-lint.yaml@2
secrets:
PAT_ACTION_CI: ${{ secrets.PAT_ACTION_CI }}
required-checks:
name: Required Checks
runs-on: ubuntu-latest
needs: [application-ci]
steps:
- name: Checkout code
uses: actions/checkout@v3