0

I am having a problem publishing my pkgdown site on GitHub pages. To demonstrate this I have generated an example package available here.

To create this package I used

devtools::create_package("~/Documents/testpackage")
usethis::use_git()
usethis::use_github()
usethis::use_pkgdown_github_pages()

I added a function that just returns a string so that the package wasn't empty, made a roxygen skeleton for it and a testthat script. I tried pushing these changes and it said my PAT didn't have the right permissions to push a GH actions change, so I logged on to GH, granted the PAT authority to do everything and tried again. This resulted in a successful push. However, the GH action that builds the pkgdown site keeps failing here

Running post deployment cleanup jobs… ️
/usr/bin/git checkout -B github-pages-deploy-action/72uicfmll
Reset branch 'github-pages-deploy-action/72uicfmll'
/usr/bin/chmod -R +rw github-pages-deploy-action-temp-deployment-folder
/usr/bin/git worktree remove github-pages-deploy-action-temp-deployment-folder --force
Error: The deploy step encountered an error: The process '/usr/bin/git' failed with exit code 128 ❌
Notice: Deployment failed! ❌

I've rerun the action from within GH multiple times and it always fails.

For package versions etc here is the output of sessionInfo()

R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.6.2

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] usethis_2.1.6

loaded via a namespace (and not attached):
 [1] pillar_1.8.1      compiler_4.1.2    sys_3.4           tools_4.1.2      
 [5] digest_0.6.30     testthat_3.1.4    evaluate_0.15     jsonlite_1.8.0   
 [9] memoise_2.0.1     lifecycle_1.0.3   tibble_3.1.8      pkgconfig_2.0.3  
[13] rlang_1.0.6       cli_3.4.1         rstudioapi_0.14   curl_4.3.2       
[17] yaml_2.3.5        xfun_0.31         pkgdown_2.0.6     fastmap_1.1.0    
[21] knitr_1.39        withr_2.5.0       httr_1.4.3        desc_1.4.1       
[25] fs_1.5.2          vctrs_0.5.0       gitcreds_0.1.1    askpass_1.1      
[29] rprojroot_2.0.3   gert_1.6.0        glue_1.6.2        R6_2.5.1         
[33] processx_3.7.0    gh_1.3.0          fansi_1.0.3       rmarkdown_2.14   
[37] callr_3.7.1       purrr_0.3.4       magrittr_2.0.3    whisker_0.4      
[41] ps_1.7.1          htmltools_0.5.3   credentials_1.3.2 utf8_1.2.2       
[45] openssl_2.0.2     cachem_1.0.6      crayon_1.5.1      brio_1.1.3  
Hugh Warden
  • 454
  • 4
  • 14

1 Answers1

1

I think this is due to a Github change from a month or two ago -- Github actions no longer have default write permission on your repository.

To fix it, open the repository settings, and go to

Actions | General | Workflow Permissions

and check Read and Write Permissions there.

user2554330
  • 37,248
  • 4
  • 43
  • 90