R语言 pkgdown github操作失败

k3bvogb1  于 2023-04-03  发布在  Git
关注(0)|答案(1)|浏览(251)

我在GitHub页面上发布我的pkgdown网站时遇到问题。为了演示这个问题,我生成了一个可用的here示例包。
为了创建这个包我用了

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

我添加了一个函数,它只返回一个字符串,这样包就不是空的,为它做了一个roxygen backbone 和一个testthat脚本。我尝试推送这些更改,它说我的PAT没有正确的权限推送GH操作更改,所以我登录GH,授予PAT权限做一切,然后再试一次。这导致成功推送。然而,构建pkgdown站点的GH操作在此处一直失败

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! ❌

我已经在GH中多次重新运行该操作,但总是失败。
对于包版本等,这里是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
uwopmtnx

uwopmtnx1#

我认为这是由于Github在一两个月前的一个变化-- Github操作不再对你的存储库有默认的写权限。
要修复此问题,请打开存储库设置,然后转到

Actions | General | Workflow Permissions

在这里检查Read and Write Permissions

相关问题