JuliaDocs/Documenter.jl

Limitations of the PR preview GITHUB_TOKEN permission heuristic

Open

#1,572 opened on 2021年4月30日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)Julia (513 forks)batch import
Type: DocumentationType: Enhancementhelp wanted

Repository metrics

Stars
 (910 stars)
PR merge metrics
 (平均マージ 16d 9h) (30d で 3 merged PRs)

説明

The heuristic implemented in #1567 to check whether GITHUB_TOKEN actually has a write permissions does not work in some non-standard configurations. E.g.

In those cases, the GITHUB_TOKEN check fails with a warning like

┌ Warning: Unable to verify if PR comes from destination repository
└ @ Documenter ~/.julia/packages/Documenter/6gbbg/src/deployconfig.jl:531

and deploydocs will attempt to deploy, just in case. If that deploy fails, e.g. if it is a PR from a fork, it will throw and likely fail the CI build (so you can still run into #1534).

What would help here are:

  1. Make the heuristic smarter. Or perhaps not throwing on PR preview deploy failures at all?
  2. Improve the error message.

Workaround. If you do run into this, a way to avoid spurious CI failures is to do your own check whether deployment should occur in make.jl. For example, if you are anyway using DOCUMENTER_KEY for authentication, you could use this pattern

isempty(get(ENV, "DOCUMENTER_KEY", "")) || deploydocs(...)

to avoid running deploydocs on PRs from forks.

コントリビューターガイド