Skip to content

Add open-source project scaffolding #1

Add open-source project scaffolding

Add open-source project scaffolding #1

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: PSScriptAnalyzer
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Install PSScriptAnalyzer
shell: pwsh
run: Install-Module PSScriptAnalyzer -Force -Scope CurrentUser -ErrorAction Stop
- name: Analyze PowerShell scripts
shell: pwsh
run: |
$results = Invoke-ScriptAnalyzer -Path . -Recurse -Severity Warning, Error
if ($results) {
$results | Format-Table -AutoSize | Out-String -Width 200 | Write-Host
Write-Host "::error::PSScriptAnalyzer reported $($results.Count) finding(s)"
exit 1
}
Write-Host 'No findings.'
json:
name: Validate JSON
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Parse every JSON file
run: |
set -euo pipefail
find . -name '*.json' -not -path './.git/*' -print0 |
xargs -0 -r -I{} sh -c 'python3 -c "import json,sys; json.load(open(sys.argv[1]))" "{}" || exit 1'
echo "All JSON files parse."