Browse Source

test comment

pull/75/head
Fredrik Ekre 6 years ago
parent
commit
572ef33210
  1. 1
      .github/workflows/docs.yml
  2. 12
      docs/make.jl

1
.github/workflows/docs.yml

@ -20,4 +20,5 @@ jobs:
- name: Build and deploy - name: Build and deploy
env: env:
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia --project=docs --color=yes docs/make.jl run: julia --project=docs --color=yes docs/make.jl

12
docs/make.jl

@ -81,6 +81,18 @@ if get(ENV, "GITHUB_EVENT_NAME", nothing) == "pull_request"
devurl = "preview-PR$(PR)", devurl = "preview-PR$(PR)",
repo = "github.com/fredrikekre/Literate.jl.git", repo = "github.com/fredrikekre/Literate.jl.git",
) )
# Add a comment on the PR with a link to the preview
# TODO: URL available from JSON.parsefile(ENV["GITHUB..."])["pull_request"]["comments_url"]
msg = "Documentation built successfully, a preview can be found here: https://fredrikekre.github.io/Literate.jl/preview-PR$(PR)"
cmd = `curl -X POST`
push!(cmd.exec, "-H", "Authorization: token $(ENV["GITHUB_TOKEN"])")
push!(cmd.exec, "-H", "Content-Type: application/json")
push!(cmd.exec, "-d", "'{\"body\":\"$(msg)\"}'")
push!(cmd.exec, "https://api.github.com/repos/fredrikekre/Literate.jl/issues/$(PR)/comments")
try
success(cmd)
catch
end
exit(0) exit(0)
end end

Loading…
Cancel
Save