38
38
os : [ubuntu-latest, windows-latest, macos-latest]
39
39
runs-on : ${{ matrix.os }}
40
40
steps :
41
-
42
- - name : Get merged pull request
43
- uses : actions-ecosystem/action-get-merged-pull-request@v1
44
- id : get_merged_pull_request
45
- with :
46
- github_token : ${{ secrets.GITHUB_TOKEN }}
47
- - name : Print merged pull request
48
- run : echo 'PR number = ${{steps.get_merged_pull_request.outputs.number}}'
49
-
50
41
- name : Setup PostgreSQL
51
42
uses : ikalnytskyi/action-setup-postgres@v4
52
43
with :
77
68
Write-Host "$(pwsh --version) is installed at $PSHOME"
78
69
psql --version
79
70
Write-Host "Using .NET SDK: $(dotnet --version)"
80
- - name : Print messages
81
- shell : pwsh
82
- env :
83
- MY_MSG : " Auto-generated documentation from ${{ github.event.pull_request.merged == true && github.event.pull_request.url || github.sha }}"
84
- run : |
85
- Write-Host "Message = $env:MY_MSG"
86
- - name : Dump event object
87
- shell : pwsh
88
- env :
89
- MY_JSON : " ${{toJSON(github.event)}}"
90
- run : |
91
- Write-Host "Message = $env:MY_JSON"
92
- #
93
71
- name : Git checkout
94
72
uses : actions/checkout@v3
95
73
- name : Restore tools
@@ -281,6 +259,16 @@ jobs:
281
259
run : |
282
260
dotnet nuget add source --username 'json-api-dotnet' --password "$env:GITHUB_TOKEN" --store-password-in-clear-text --name 'github' 'https://nuget.pkg.github.com/json-api-dotnet/index.json'
283
261
dotnet nuget push "$env:GITHUB_WORKSPACE/packages/*.nupkg" --api-key "$env:GITHUB_TOKEN" --source 'github'
262
+ - name : Find merged pull request
263
+ uses : actions-ecosystem/action-get-merged-pull-request@v1
264
+ id : find_merged_pull_request
265
+ with :
266
+ github_token : ${{ secrets.GITHUB_TOKEN }}
267
+ # TODO: Remove test
268
+ - name : Print merged pull request
269
+ run : |
270
+ echo 'PR number = ${{ steps.find_merged_pull_request.outputs.number }}'
271
+ echo 'SHA = ${{ github.sha }}'
284
272
- name : Publish documentation
285
273
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
286
274
uses : peaceiris/actions-gh-pages@v3
@@ -291,7 +279,7 @@ jobs:
291
279
# publish_branch: gh-pages
292
280
publish_dir : ./documentation
293
281
# commit_message: 'Auto-generated documentation from: ${{ github.event.head_commit.message }}'
294
- full_commit_message : " Auto-generated documentation from ${{ github.event.pull_request.merged == true && github.event.pull_request.url || github.sha }}"
282
+ full_commit_message : " Auto-generated documentation from ${{ steps.find_merged_pull_request.outputs.number && format('#{0}', steps.find_merged_pull_request.outputs.number) || github.sha }}"
295
283
296
284
- name : Publish to NuGet
297
285
if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
0 commit comments