标签: github-actions

致命:无法读取“https://***@github.com”的密码:没有这样的设备或地址

我目前正在开始学习如何使用 Github Actions,并且遇到了身份验证问题,Github 能够检索我的用户名,但不能检索我的密码,这是错误(错误发生在Deploy to GH Pages上):

create mode 100644 static/media/flow.edad2ac1.svg
create mode 100644 static/media/plugin.d494b228.svg
create mode 100644 static/media/repo.6d496322.svg
create mode 100644 static/media/stackalt.dba9fbb3.svg
fatal: could not read Password for 'https://***@github.com': No such device or address
Run Code Online (Sandbox Code Playgroud)

我试图部署到 GH 页面,代码如下:

  deployToGhPages:
    name: Deploy to GH Pages
    needs: [lint, tests]
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup
        uses: actions/setup-node@v2
        with:
          node-version: 16

      - uses: actions/cache@v2
        id: cache
        with:
          path: |
            node_modules
            */*/node_modules
          key: ${{ secrets.CACHE_VERSION }}-${{ runner.os …
Run Code Online (Sandbox Code Playgroud)

github-pages github-actions

7
推荐指数
1
解决办法
8460
查看次数

github actions 检测秘密是否存在

在我的 GitHub 操作之一中,我想在尝试使用机密之前测试该机密是否存在,以便为用户提供信息更丰富的错误消息。我当前的策略是在操作开始时添加以下步骤:

- name: check if MY_SECRET exists
  run: if [ `echo ${{secrets.MY_SECRET}} | wc -c` -lt 2 ]; then echo the secret \"MY_SECRET\" has not been made; echo please go to \"settings \> secrets \> actions\" to create it; exit 1; fi
Run Code Online (Sandbox Code Playgroud)

这是对没有任何错误处理的改进,因为它阻止了操作的继续,并为用户提供了一些有用的建议,但是我想知道是否有“更好”的解决方案。特别是,GitHub 对于如何处理这种情况有建议吗?例如,我可以调用来自市场的其他操作吗?(我检查了市场,但找不到任何可以做到这一点的东西,但是我可能错过了一些东西)。

在我看来,这就像一个我可能想要经常重用的功能,因此假设没有市场或内置解决方案,我打算制定自己的操作,我可以调用该操作来为我做到这一点。我注意到市场上的很多操作都是在节点中实现的。这被认为比 bash 更好吗?我有什么理由不应该在 bash 中实现此功能吗?

最后,当我在这里处理机密时,我想牢记安全。在提出任何解决方案时请记住这一点。另外,请出于安全考虑批评我当前的解决方案。

github github-actions

7
推荐指数
1
解决办法
4799
查看次数

Github Actions - 达到堆限制分配失败

Github Action 给出了最后一个“run: npm run build”的错误

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Error: Process completed with exit code 1.
Run Code Online (Sandbox Code Playgroud)

我的工作流程文件

name: Node.js CI

on:
  push:
    branches: ['master']

jobs:
  build:
    runs-on: self-hosted

    strategy:
      matrix:
        node-version: [16.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}
          cache: 'npm'
      - run: npm i
      - run: npm i
        working-directory: client …
Run Code Online (Sandbox Code Playgroud)

javascript github npm github-actions

7
推荐指数
1
解决办法
9850
查看次数

GitHub Actions - 如何在作业级别使用环境变量?

我想在工作级别使用环境变量。有办法做到吗?

env:
  stageEnv: UAT

jobs:
  name: Upload Build
  if: ${{ env.stageEnv == 'UAT' }}
  steps:
    ....
Run Code Online (Sandbox Code Playgroud)

我收到无法识别的命名值:'env'错误。尝试了 $stageEnv 和 ${{ env.stageEnv }}

注意:当我在“步骤”内访问时它可以工作,但希望可以在“作业”级别访问它。

github-actions

7
推荐指数
1
解决办法
2349
查看次数

GitHub 操作 setup-r-dependency 失败,说明没有名为“digest”的包

我一直在尝试设置一些 GitHub 操作来自动检查我的 R 包并运行测试覆盖率。我目前正在使用 setup-r-dependency@v2 操作来安装依赖项,但无法安装包“digest”。返回以下错误:

\n
 Error: Error: <callr_remote_error: Cannot install packages:\n  * deps::.: there is no package called \xe2\x80\x98digest\xe2\x80\x99>\n   in process 8254 \n  -->\n  <simpleError: Cannot install packages:\n  * deps::.: there is no package called \xe2\x80\x98digest\xe2\x80\x99>\n
Run Code Online (Sandbox Code Playgroud)\n

包内依赖如下:

\n
Imports:\n    assertthat,\n    crayon,\n    forcats,\n    rmarkdown,\n    purrr,\n    ggplot2,\n    htmltools,\n    lubridate,\n    dplyr,\n    tidyselect,\n    rlang,\n    INLA,\n    arm,\n    magrittr,\n    glue,\n    googleAuthR,\n    googleCloudStorageR,\n    stringr\n
Run Code Online (Sandbox Code Playgroud)\n

最后,失败的工作流程本身如下所示(取自 tidyverse 包):

\n
on:\n  push:\n    branches: [main, dev]\n  pull_request:\n    branches: [main, dev]\n\nname: test-coverage\n\njobs:\n  test-coverage:\n    runs-on: ubuntu-latest\n    env:\n …
Run Code Online (Sandbox Code Playgroud)

r github github-actions

7
推荐指数
0
解决办法
862
查看次数

在 github 上测试超时但在本地完成

我的 python 项目中有pytest单元测试,每次推送到 github 时都会运行该测试。最近,(windows, python 3.9) 和 (windows, python 3.10) 上的测试即使在 6 小时后也没有完成,我试图找出原因。

对于上下文:

  • 这不仅仅是 python 版本,因为 python 3.9 和 3.10 在 mac 和 linux 上完成。另外,它不仅仅是 Windows 版本,因为 Windows 已经完成了 python 3.8。他们都最多在 1 小时内完成。

    在此输入图像描述

  • 在本地,使用 python 3.9 的 Windows 在 <1 小时内完成。在全新的 conda 虚拟环境中也是如此。

    在此输入图像描述

  • 即使推送以前不会造成问题的代码版本,现在也会遇到超时。所以我认为这不是我的代码中的东西,而是依赖项或 github 操作的设置方式(?)。我对此了解不够,无法做出明智的评估。

非常感谢任何调试方面的帮助。

是该项目,是测试结果的示例。


编辑:我查看了 3 个 Windows 案例中的每一个的安装日志并进行了比较。以下是差异:

{'missing': {'typing-extensions': {'38': '4.4.0', '39': '4.4.0'}},
 'different': {'setuptools': {'38': '56.0.0', '39': '58.1.0', '310': '63.2.0'}}}
Run Code Online (Sandbox Code Playgroud)

如果这是罪魁祸首,我会感到惊讶setuptools- 它不是只在安装软件包时使用吗?此外,Mac 上的 3.9 …

python numpy pytest pandas github-actions

7
推荐指数
0
解决办法
769
查看次数

使用 Gradle 托管设备进行 Android Github 操作

我尝试使用Gradle 托管设备和 Github 操作进行 CI 测试。我做了几次尝试,但大多遇到

 Execution failed for task ':app:nexusOneApi30Setup'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.ManagedDeviceSetupTask$ManagedDeviceSetupRunnable
   > java.lang.IllegalStateException: Gradle was not able to complete device setup for: dev30_aosp_atd_x86_Nexus_One
     This could be due to having insufficient resources to provision the number of
     devices requested. Try running the test again and request fewer devices or
     fewer shards.
Run Code Online (Sandbox Code Playgroud)

作为来源,我在我的fork中使用https://github.com/android/testing-samples/tree/main/ui/espresso/ScreenshotSample,它在本地正常工作

android android-espresso github-actions gradle-managed-device

7
推荐指数
1
解决办法
627
查看次数

Github Actions 中的并发是什么?

有人可以用简单的英语解释一下 Github Actions 上作业级别和工作流程级别的并发性是如何工作的吗?我只是无法理解这个概念:(提前谢谢你。

github github-actions

7
推荐指数
1
解决办法
8064
查看次数

如何在 Github Actions 工作流程 YAML 中引用部署环境名称?

我想访问我的 Github Actions 工作流程 YAML 中的部署环境名称。这是一个例子:

jobs:
  example:
    runs-on: ubuntu-latest
    environment: "foobarbaz"
    ...

    steps:
      ...
      - name: Terraform Check Format
        id: terraform-fmt
        # what should I use here instead of "????" to get "foobarbaz"?
        run: terraform -chdir=terraform/stacks/${{ ???? }}/${{ matrix.stack }} fmt -check
Run Code Online (Sandbox Code Playgroud)

github github-enterprise github-actions

7
推荐指数
1
解决办法
1889
查看次数

GitHub 操作:NPM 发布失败并出现 ERR!代码 ENEEDAUTH

我尝试实现使用 GitHub Actions 发布和安装包的官方指南:使用细化权限验证包注册表

失败:

npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in to https://npm.pkg.github.com
npm ERR! need auth You need to authorize this machine using `npm adduser`
Run Code Online (Sandbox Code Playgroud)

包.json

npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in to https://npm.pkg.github.com
npm ERR! need auth You need to authorize this machine using `npm adduser`
Run Code Online (Sandbox Code Playgroud)

.github/workflow/ci.yml

{
  "name": "@charneykaye/banana",
  "version": "4.0.6",
  "repository": "git@github.com:charneykaye/banana",
  "description": "made by …
Run Code Online (Sandbox Code Playgroud)

node.js npm npm-publish github-actions github-package-registry

7
推荐指数
1
解决办法
6303
查看次数