File tree 2 files changed +20
-12
lines changed
2 files changed +20
-12
lines changed Original file line number Diff line number Diff line change 13
13
14
14
permissions :
15
15
id-token : write
16
- contents : write
16
+ contents : read
17
17
issues : write
18
18
pull-requests : write
19
19
@@ -75,10 +75,15 @@ jobs:
75
75
- name : Lint OpenAPI doc
76
76
shell : pwsh
77
77
run : |
78
- $LINT_RESULT = spectral lint -f json -F warn -D openapi.json
79
-
80
- if( $LINT_RESULT.Count -ge 1) {
81
- $LINT_RESULT
78
+ $LINT_RESULT = spectral lint -f json -F warn -D -q openapi.json | ConvertFrom-Json
79
+
80
+ if( $LINT_RESULT.Count -gt 0) {
81
+ $LINT_RESULT | ForEach-Object {
82
+ echo ("code: " + $_.code)
83
+ echo ("message: " + $_.message)
84
+ echo ("path: " + $_.path)
85
+ echo "`n"
86
+ }
82
87
exit 1
83
88
}
84
89
Original file line number Diff line number Diff line change 10
10
11
11
permissions :
12
12
id-token : write
13
- contents : write
13
+ contents : read
14
14
15
15
jobs :
16
16
build-test-deploy :
@@ -82,19 +82,22 @@ jobs:
82
82
83
83
Start-Sleep -Seconds 30
84
84
85
- Remove-Item -Path "openapi.json" -Force
86
-
87
85
Invoke-WebRequest -Uri "https://localhost:7001/swagger/$API_VERSION/swagger.json" -OutFile "openapi.json"
88
86
89
87
$PROCESS.Kill()
90
88
91
89
- name : Lint OpenAPI doc
92
90
shell : pwsh
93
91
run : |
94
- $LINT_RESULT = spectral lint -f json -F warn -D openapi.json
95
-
96
- if( $LINT_RESULT.Count -ge 1) {
97
- $LINT_RESULT
92
+ $LINT_RESULT = spectral lint -f json -F warn -D -q openapi.json | ConvertFrom-Json
93
+
94
+ if( $LINT_RESULT.Count -gt 0) {
95
+ $LINT_RESULT | ForEach-Object {
96
+ echo ("code: " + $_.code)
97
+ echo ("message: " + $_.message)
98
+ echo ("path: " + $_.path)
99
+ echo "`n"
100
+ }
98
101
exit 1
99
102
}
100
103
You can’t perform that action at this time.
0 commit comments