Skip to content

Commit

Permalink
Add PSScriptAnalyzer action (#59)
Browse files Browse the repository at this point in the history
Also fix some style problem found by PSScriptAnalyzer.

Pull request: #59
  • Loading branch information
FantasqueX authored Feb 1, 2024
1 parent df55f35 commit 2254cf0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
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

0 comments on commit 2254cf0

Please sign in to comment.