From 8005efdbbb28ada3e5c8aa903ba430024c4ff928 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Thu, 26 Nov 2015 02:38:29 +0100 Subject: [PATCH] phpDocs auto deployment: Remove latest commit check for pull requests 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. --- build/deploy-phpdoc-branch.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/deploy-phpdoc-branch.sh b/build/deploy-phpdoc-branch.sh index 1b3e11e..b3d4b2f 100755 --- a/build/deploy-phpdoc-branch.sh +++ b/build/deploy-phpdoc-branch.sh @@ -6,7 +6,7 @@ if [ "$TRAVIS_PHP_VERSION" != "5.3" ]; then fi if [[ ",$DEPLOY_PHPDOC_BRANCHES," != *,"$TRAVIS_BRANCH",* ]]; then - echo "Skipping phpDoc deployment because this branch is not permitted to deploy" + echo "Skipping phpDoc deployment because this branch ($TRAVIS_BRANCH) is not permitted to deploy" exit fi @@ -16,7 +16,7 @@ if [ "$TRAVIS_SECURE_ENV_VARS" != "true" ]; then fi PHPDOC_ID="${TRAVIS_BRANCH//\//_}" -PHPDOC_REF="heads/$TRAVIS_BRANCH" +PHPDOC_REF="heads/$TRAVIS_BRANCH @ $TRAVIS_COMMIT" PHPDOC_REF_TEXT="$TRAVIS_BRANCH branch" if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then @@ -36,6 +36,6 @@ generate-phpdoc.sh \ [ $? -eq 0 ] || exit 1 deploy-phpdoc.sh \ - "$TRAVIS_REPO_SLUG" "$PHPDOC_REF @ $TRAVIS_COMMIT" "$TRAVIS_BUILD_DIR/build/phpdoc-$PHPDOC_ID" \ + "$TRAVIS_REPO_SLUG" "$PHPDOC_REF" "$TRAVIS_BUILD_DIR/build/phpdoc-$PHPDOC_ID" \ "$TRAVIS_REPO_SLUG" "gh-pages" "phpDoc/$PHPDOC_ID" [ $? -eq 0 ] || exit 1