swh:1:snp:bdc19e867479541d0f4994ceaa711217d0dc28ed
Tip revision: 74b598025322cd572dcd58326f0c5fb465f503ab authored by Hadley Wickham on 23 June 2022, 13:00:02 UTC
version 2.0.5
version 2.0.5
Tip revision: 74b5980
test-deploy-site.R
# ci_commit_sha() ------------------------------------------------------------
test_that("commit sha can be retrieved from travis or GitHub action env vars", {
sha <- "XYZ"
withr::with_envvar(
c("TRAVIS_COMMIT" = sha, "GITHUB_SHA" = ""),
expect_equal(ci_commit_sha(), sha)
)
withr::with_envvar(
c("TRAVIS_COMMIT" = "", "GITHUB_SHA" = sha),
expect_equal(ci_commit_sha(), sha)
)
withr::with_envvar(
c("TRAVIS_COMMIT" = "", "GITHUB_SHA" = ""),
expect_equal(ci_commit_sha(), "")
)
})