【发布时间】:2021-11-13 23:01:17
【问题描述】:
基于this article,我正在尝试生成一个在每次推送时运行的存储库,但也每 4 或 8 小时运行一次。如action history 所见,只有其中一个成功,并且仅在 Mac 机器上:
但我的目标是在 ubuntu-latest、windows-latest 和 macos-latest 上运行它以检查所有操作系统中的代码。最后一个目标是使计划推送的消息在 xxx 日期更新。这是我的最新代码9 月 23 日编辑,可以在 this repo 中看到:
name: render readme
on:
push:
paths:
- README.Rmd
schedule:
- cron: 0 */4 * * *
jobs:
render:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v1
- name: "[Custom block] [macOS] Install spatial libraries"
if: runner.os == 'macOS'
run: |
# conflicts with gfortran from r-lib/actions when linking gcc
rm '/usr/local/bin/gfortran'
brew install pkg-config gdal proj geos
- name: "[Stage] [macOS] Install libgit2"
if: runner.os == 'macOS'
run: brew install libgit2
- name: Install packages
run: Rscript -e 'install.packages(c("rmarkdown", "pacman", "rgeos"))'
- name: install rgdal
run: Rscript -e 'install.packages("rgdal", configure.args = c("--with-proj-lib=/usr/local/lib/", "--with-proj-include=/usr/local/include/"))'
- name: Render README
run: Rscript -e 'rmarkdown::render("README.Rmd", output_format = "md_document")'
- name: Commit results
run: |
git add README.md man/figures/README-*
git commit README.md -am 'Re-build README.md' || echo "No changes to commit"
git push origin main || echo "No changes to commit"
现在它运行了,它实际上给了我一个勾号,但是 md 没有更新,在名为 commit results 的任务的运行中,我们可以看到以下错误
Run git add README.md man/figures/README-*
git add README.md man/figures/README-*
git commit README.md -am 'Re-build README.md' || echo "No changes to commit"
git push origin main || echo "No changes to commit"
shell: /bin/bash -e {0}
env:
R_LIBS_USER: /Users/runner/work/_temp/Library
TZ: UTC
_R_CHECK_SYSTEM_CLOCK_: FALSE
NOT_CRAN: true
fatal: paths 'README.md ...' with -a does not make sense
No changes to commit
Everything up-to-date
所以提交或推送不起作用,谢谢@krzysztof-madej,你发现了一个错误,那就是分支名称,但我仍然可以让结果更新自述文件,即使它运行顺利
【问题讨论】:
标签: r r-markdown github-actions