Repository Maintenance #66
This file contains hidden or 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
| name: Repository Maintenance | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| maintenance: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Cache PowerShell modules | |
| uses: potatoqualitee/psmodulecache@v6.2.1 | |
| with: | |
| modules-to-cache: PSScriptAnalyzer | |
| - name: Run cleanup script | |
| shell: pwsh | |
| run: ./scripts/CleanupTempFiles.ps1 | |
| - name: Check outdated modules | |
| shell: pwsh | |
| run: | | |
| . ./SupportToolsLoader.ps1 | |
| $outdated = Get-InstalledModule | Where-Object { $_.UpdateAvailable } | |
| if ($outdated) { | |
| $outdated | Format-Table Name, Version, LatestVersion | |
| } else { | |
| Write-STStatus 'All modules are up to date.' -Level INFO -Log | |
| } | |
| - name: Lint with PSScriptAnalyzer | |
| shell: pwsh | |
| run: | | |
| Invoke-ScriptAnalyzer -Path . -Recurse -Severity Warning,Error |