【问题标题】:Configuring codecov token in GitHub Actions .yaml for an R package在 GitHub Actions .yaml 中为 R 包配置 codecov 令牌
【发布时间】:2020-06-03 18:56:05
【问题描述】:

我正在尝试为公共 R 包设置 codecov 监控,GitHub Actions 将在其中运行 covr::codecov。我正在查看这个 .yaml 示例 (Source):

  - name: Test coverage
    if: matrix.r == '3.6'
    run: |
      Rscript -e 'remotes::install_github("r-lib/covr@gh-actions")'
      Rscript -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")'

将我的 codecov 令牌放在 .yaml 文件中代替上面示例中 CODECOV_TOKEN 的位置对我来说安全吗?

【问题讨论】:

    标签: r github-actions codecov


    【解决方案1】:

    不,不要将令牌放在 .yaml 文件中。要与 GitHub Actions 一起使用,请将令牌添加到 GitHub 存储库的 Secrets 部分,然后保持上面的 .yaml 代码不变。

    在 URL 中添加密钥(使用您的姓名修改):https://github.com/USERNAME/REPONAME/settings/secrets 并将其命名为 CODECOV_TOKEN。然后这个 .yaml 代码会找到它。

    (您从 https://codecov.io/gh/USERNAME/REPONAME 获得 repo 的 codecov 令牌)

    【讨论】:

      猜你喜欢
      • 2020-03-17
      • 1970-01-01
      • 1970-01-01
      • 2021-02-05
      • 1970-01-01
      • 1970-01-01
      • 2020-11-30
      • 2022-08-08
      • 2020-09-09
      相关资源
      最近更新 更多