File tree Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 4
4
push :
5
5
branches :
6
6
- ' master'
7
- - ' create-pull-request/patch '
7
+ - ' create-pull-request/package-update '
8
8
tags : ' *'
9
9
pull_request :
10
10
Original file line number Diff line number Diff line change 27
27
uses : peter-evans/create-pull-request@v3
28
28
with :
29
29
title : ' Automatic Pkg.update()'
30
+ branch : ' create-pull-request/package-update'
30
31
author :
' GitHub <[email protected] >'
31
32
body : |
32
33
Automatic `Pkg.update()` with the following changes:
Original file line number Diff line number Diff line change @@ -97,8 +97,25 @@ makedocs(
97
97
),
98
98
)
99
99
100
- deploydocs (
101
- versions = nothing ,
102
- push_preview = true ,
103
- repo = " github.com/JuliaLogging/julialogging.github.io.git" ,
104
- )
100
+ # Hack to deploy preview builds from package auto-update
101
+ # This is necessary since when using the create-pull-request action, the PR is opened
102
+ # by the github-actions user authenticating with the default GITHUB_TOKEN, which also
103
+ # means that regular CI will not be triggered. This is circumvented by using a SSH key
104
+ # with the actions/checkout action when cloning, which means that the resulting commit
105
+ # is pushed with the same SSH key triggering a "push" event build. However, Documenter
106
+ # only builds previews for the "pull_request" event type, so we need to pretend to be
107
+ # a "pull_request" event type by temporarily setting some environment variables.
108
+ env = Dict {String,String} ()
109
+ if ENV [" GITHUB_EVENT_NAME" ] == " push" &&
110
+ ENV [" GITHUB_REF" ] == " refs/heads/create-pull-request/package-update"
111
+ env[" GITHUB_EVENT_NAME" ] = " pull_request"
112
+ env[" GITHUB_REF" ] = " refs/pull/1234/merge"
113
+ end
114
+
115
+ withenv (env... ) do
116
+ deploydocs (
117
+ versions = nothing ,
118
+ push_preview = true ,
119
+ repo = " github.com/JuliaLogging/julialogging.github.io.git" ,
120
+ )
121
+ end
You can’t perform that action at this time.
0 commit comments