We can deploy phpDocs in safe environments only, but "safe environment" is equivalent to "pull a local branch", therefore we can simply use that local branch to deploy the phpDocs. There's no need for a explicit pull request support.
See https://developer.github.com/v3/pulls/#get-a-single-pull-request
> Each time the pull request receives new commits, GitHub creates a merge
> commit to *test* whether the pull request can be automatically merged into
> the base branch. (This *test* commit is not added to the base branch or the
> head branch.) The attribute holds the SHA of the *test*
> merge commit; however, this attribute is deprecated and is scheduled for
> removal in the next version of the API.
holds the SHA of the merge commit and not of the
latest commit of the head branch, therefore the comparison fails. We could
theoretically compare it against this attribute, but as of its deprecation,
this is a pretty bad idea. Thus we remove the latest commit check for pull
requests.
* [Changed] move everything inside /build/ directory
* [Changed] use absolute file paths in script
* [Changed] copy docs to both the release number and master dirs
Implement @PhrozenByte 's suggestions.
* [Changed] use `$GITHUB_OAUTH_TOKEN` instead of `$GITHUB_TOKEN`