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

Add PSScriptAnalyzer action #59

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on: [push, pull_request]

jobs:
check:
shell:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand All @@ -12,4 +12,15 @@ jobs:
run: sudo apt-get install -y make shellcheck

- name: Check
run: make clean check
run: make clean check

PowerShell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Run PSScriptAnalyzer
uses: microsoft/psscriptanalyzer-action@v1.1
with:
path: .\millw.ps1
enableExit: true
7 changes: 3 additions & 4 deletions millw.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is a wrapper script, that automatically download mill from GitHub release pages
# You can give the required mill version with -MillVersion parameter
# You can give the required mill version with --mill-version parameter
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
#
# Project page: https://github.com/lefou/millw
Expand Down Expand Up @@ -69,10 +69,9 @@ if ($null -eq $MILL_VERSION) {

if ($null -eq $MILL_VERSION) {
Write-Output 'Retrieving latest mill version ...'

# https://github.com/PowerShell/PowerShell/issues/20964
$targetUrl =
try {
$targetUrl = try {
Invoke-WebRequest -Uri "$MILL_REPO_URL/releases/latest" -MaximumRedirection 0
}
catch {
Expand Down
Loading