File tree 4 files changed +40
-6
lines changed
4 files changed +40
-6
lines changed Original file line number Diff line number Diff line change 1
1
# CI workflow for validating action
2
2
name : Build
3
3
on :
4
- - pull_request
5
- - push
4
+ push :
5
+ branches : [ main, 'release/*' ]
6
+ pull_request :
7
+ branches : [ main, 'release/*' ]
8
+
6
9
jobs :
10
+
11
+ test :
12
+ name : ' Tests'
13
+ runs-on : ubuntu-latest
14
+ permissions :
15
+ contents : read
16
+ steps :
17
+
18
+ - name : Checkout
19
+
20
+
21
+ - name : Run PSRule v1
22
+ uses : ./
23
+ with :
24
+ inputType : repository
25
+ modules : PSRule.Rules.MSFT.OSS
26
+
27
+ - name : Run PSRule v2
28
+ uses : ./
29
+ with :
30
+ inputType : repository
31
+ modules : PSRule.Rules.MSFT.OSS
32
+ prerelease : true
33
+ version : ' 2.0.0-B2202017'
34
+
7
35
run :
8
36
name : Analyze repository
9
37
runs-on : ubuntu-latest
38
+ needs : ' test'
39
+ permissions :
40
+ contents : read
10
41
steps :
11
42
12
43
- name : Checkout
13
44
14
45
15
- - name : Run PSRule analysis
46
+ - name : Run PSRule self analysis
16
47
uses : ./
17
48
with :
18
49
inputType : repository
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ What's changed since v1.12.0:
18
18
To configure this:
19
19
- Set the ` prerelease ` parameter to ` true ` to include pre-release versions.
20
20
- Set the ` version ` parameter to ` 2.0.0-B2201161 ` or newer version.
21
+ - Bug fixes:
22
+ - Fixed import of pre-release version. [ #138 ] ( https://github.com/microsoft/ps-rule/issues/138 )
21
23
22
24
## v1.12.0
23
25
Original file line number Diff line number Diff line change @@ -179,17 +179,18 @@ foreach ($m in $moduleNames) {
179
179
}
180
180
}
181
181
catch {
182
- Write-Host " ::error::An error occured installing a dependency module '$m '." ;
182
+ Write-Host " ::error::An error occurred installing a dependency module '$m '. $ ( $_ .Exception.Message ) " ;
183
183
$Host.SetShouldExit (1 );
184
184
}
185
185
}
186
186
187
187
try {
188
+ $checkParams = @ { RequiredVersion = $checkParams.RequiredVersion.Split (' -' )[0 ] }
188
189
$Null = Import-Module PSRule @checkParams - ErrorAction Stop;
189
190
$version = (Get-Module PSRule).Version;
190
191
}
191
192
catch {
192
- Write-Host " ::error::An error occured importing module 'PSRule'." ;
193
+ Write-Host " ::error::An error occurred importing module 'PSRule'. $ ( $_ .Exception.Message ) " ;
193
194
$Host.SetShouldExit (1 );
194
195
}
195
196
Original file line number Diff line number Diff line change 6
6
# https://microsoft.github.io/PSRule/
7
7
8
8
requires :
9
- PSRule : ' >=1.11.0'
9
+ PSRule : ' @pre >=1.11.0'
10
10
11
11
output :
12
12
culture :
You can’t perform that action at this time.
0 commit comments