Skip to content
This repository has been archived by the owner on Oct 5, 2018. It is now read-only.

Commit

Permalink
Corrected up-to-date check for publishGhPages
Browse files Browse the repository at this point in the history
Fixes #221 by changing the up-to-date check for publishGhPages
to see if there are any unpublished commits, instead of whether
or not the prepare task did work.
  • Loading branch information
ajoberstar committed Nov 5, 2016
1 parent f6cc4c5 commit bc72a38
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -129,7 +129,12 @@ class GithubPagesPlugin implements Plugin<Project> {
return project.tasks.create(PUBLISH_TASK_NAME) {
description = 'Publishes all gh-pages changes to Github'
group = 'publishing'
onlyIf { dependsOnTaskDidWork() }
// only push if there are commits to push
onlyIf {
def repo = project.tasks[PREPARE_TASK_NAME].repo
def status = repo.branch.status(name: repo.branch.current)
status.aheadCount > 0
}
doLast {
project.tasks[PREPARE_TASK_NAME].repo.push()
}
Expand Down

0 comments on commit bc72a38

Please sign in to comment.