File tree 2 files changed +19
-18
lines changed
2 files changed +19
-18
lines changed Original file line number Diff line number Diff line change 13
13
14
14
permissions :
15
15
id-token : write
16
- contents : read
16
+ contents : write
17
17
issues : write
18
18
pull-requests : write
19
+ # checks: write
19
20
20
21
jobs :
21
22
build-test :
49
50
dotnet new tool-manifest
50
51
dotnet tool install SwashBuckle.AspNetCore.Cli
51
52
52
- - name : Install Spectral Cli
53
- shell : bash
54
- run : |
55
- curl -L https://raw.github.com/stoplightio/spectral/master/scripts/install.sh | sh
56
-
57
53
- name : Restore NuGet packages
58
54
shell : bash
59
55
run : |
@@ -64,13 +60,17 @@ jobs:
64
60
run : |
65
61
dotnet build
66
62
67
- - name : Lint OpenAPI doc
63
+ - name : Create openapi.json
68
64
shell : bash
69
- run : |
65
+ run : |
70
66
API_VERSION=$(grep -oP 'public const string Version = "\K[^"]+' ./src/AzureOpenAIProxy.ApiApp/Constants.cs)
71
67
dotnet swagger tofile --output ./openapi.json ./src/AzureOpenAIProxy.ApiApp/bin/Debug/net8.0/AzureOpenAIProxy.ApiApp.dll $API_VERSION
72
68
73
- spectral lint -f json -f github-actions -F warn openapi.json
69
+ - name : Lint OpenAPI doc
70
+ uses : stoplightio/spectral-action@latest
71
+ with :
72
+ file_glob : ' ./openapi.json'
73
+ repo_token : ${{ secrets.GH_PAT_GRAINED }}
74
74
75
75
- name : Install playwright
76
76
shell : pwsh
Original file line number Diff line number Diff line change 10
10
11
11
permissions :
12
12
id-token : write
13
- contents : read
13
+ contents : write
14
+ # checks: write
14
15
15
16
jobs :
16
17
build-test-deploy :
62
63
run : |
63
64
dotnet new tool-manifest
64
65
dotnet tool install SwashBuckle.AspNetCore.Cli
65
-
66
- - name : Install Spectral Cli
67
- shell : bash
68
- run : |
69
- curl -L https://raw.github.com/stoplightio/spectral/master/scripts/install.sh | sh
70
-
66
+
71
67
- name : Restore NuGet packages
72
68
shell : bash
73
69
run : |
@@ -78,13 +74,18 @@ jobs:
78
74
run : |
79
75
dotnet build -c Release
80
76
81
- - name : Lint OpenAPI doc
77
+ - name : Create openapi.json
82
78
shell : bash
83
79
run : |
84
80
API_VERSION=$(grep -oP 'public const string Version = "\K[^"]+' ./src/AzureOpenAIProxy.ApiApp/Constants.cs)
85
81
dotnet swagger tofile --output ./openapi.json ./src/AzureOpenAIProxy.ApiApp/bin/Debug/net8.0/AzureOpenAIProxy.ApiApp.dll $API_VERSION
86
82
87
- spectral lint -f json -f github-actions -F warn openapi.json
83
+ - name : Lint OpenAPI doc
84
+ uses : stoplightio/spectral-action@latest
85
+ with :
86
+ file_glob : ' ./openapi.json'
87
+ repo_token : ${{ secrets.GH_PAT_GRAINED }}
88
+
88
89
89
90
- name : Test solution
90
91
You can’t perform that action at this time.
0 commit comments