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 44 push :
55 branches :
66 - ' master'
7- - ' create-pull-request/patch '
7+ - ' create-pull-request/package-update '
88 tags : ' *'
99 pull_request :
1010
Original file line number Diff line number Diff line change 2727 uses : peter-evans/create-pull-request@v3
2828 with :
2929 title : ' Automatic Pkg.update()'
30+ branch : ' create-pull-request/package-update'
3031 author : ' GitHub <noreply@github.com>'
3132 body : |
3233 Automatic `Pkg.update()` with the following changes:
Original file line number Diff line number Diff line change @@ -97,8 +97,25 @@ makedocs(
9797 ),
9898)
9999
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