Skip to content

Commit 9a8c2e8

Browse files
committed
replace head SHA from API with TRAVIS_COMMIT since we want representing of what we'll see after mergin with master
1 parent d60157c commit 9a8c2e8

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

inst/testscripts/.push_test_table.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ git checkout gh-pages
2626

2727
# Read more about Travis environment variables --
2828
# http://docs.travis-ci.com/user/ci-environment/
29-
Rscript ../plotly/inst/testscripts/comment.R $TRAVIS_PULL_REQUEST $TRAVIS_BUILD_ID $GH_TOKEN
29+
Rscript ../plotly/inst/testscripts/comment.R $TRAVIS_PULL_REQUEST $TRAVIS_BUILD_ID $TRAVIS_COMMIT $GH_TOKEN

inst/testscripts/comment.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ base <- 'https://api.github.com/repos/ropensci/plotly/'
99
pr <- sprintf(paste0(base, 'pulls/%s'), a[1])
1010
header <- add_headers(`User-Agent` = "plotly",
1111
`Accept` = 'application/vnd.github.v3+json',
12-
`Authorization` = paste0("token ", a[3]))
12+
`Authorization` = paste0("token ", a[4]))
1313
# Must be successful since we grab the branch name for this pull request
1414
# and SHA1 info from the request content
1515
res <- GET(url = pr, header)
@@ -33,7 +33,7 @@ setwd("../plotly-test-table")
3333
cat("user,SHA1,label", file = "code_commits.csv")
3434
row1 <- paste0("\nropensci,", info$base$sha, ",master")
3535
cat(row1, file = "code_commits.csv", append = TRUE)
36-
row2 <- paste0("\nropensci,", info$head$sha, ",", branch)
36+
row2 <- paste0("\nropensci,", a[3], ",", branch)
3737
cat(row2, file = "code_commits.csv", append = TRUE)
3838

3939
# copy over file (created during Rscript)
@@ -48,14 +48,13 @@ system("git add data/*/*.log")
4848
commit_msg <- paste0('"Pushed from https://travis-ci.org/ropensci/plotly/builds/"', a[2])
4949
system(paste('git commit -m', commit_msg))
5050
# This post explains how this works -- http://rmflight.github.io/posts/2014/11/travis_ci_gh_pages.html
51-
repo <- paste0("https://", a[3], "@github.com/ropensci/plotly-test-table.git")
51+
repo <- sprintf("https://%s@github.com/ropensci/plotly-test-table.git", a[4])
5252
system(paste("git pull -q", repo, "gh-pages"))
5353
system(paste("git push -q", repo, "gh-pages"))
5454

5555
# post comment if a link to this SHA doesn't exist
5656
# (needed since Travis randomly re-builds stuff)
57-
tbl_link <- sprintf("http://ropensci.github.io/plotly-test-table/tables/%s/index.html",
58-
info$head$sha)
57+
tbl_link <- sprintf("http://ropensci.github.io/plotly-test-table/tables/%s/index.html", a[3])
5958
commentz <- sprintf(paste0(base, 'issues/%s/comments'), a[1])
6059
res <- GET(commentz, header)
6160
warn_for_status(res)

0 commit comments

Comments
 (0)